2021-07-12 03:22:10 +00:00
|
|
|
From 5bd43bca1708a56d32e63da0278e04caf2865927 Mon Sep 17 00:00:00 2001
|
2020-10-19 18:24:09 +00:00
|
|
|
From: Al Stone <ahs3@redhat.com>
|
2021-07-12 03:22:10 +00:00
|
|
|
Date: Tue, 29 Jun 2021 17:38:20 -0600
|
|
|
|
Subject: [PATCH 41/45] Support IORT in a big-endian world
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
Signed-off-by: Al Stone <ahs3@redhat.com>
|
|
|
|
---
|
2021-07-12 03:22:10 +00:00
|
|
|
source/common/dmtbdump2.c | 85 ++++++++++++++++++++++----------------
|
|
|
|
source/compiler/dttable1.c | 40 ++++++++++--------
|
|
|
|
2 files changed, 72 insertions(+), 53 deletions(-)
|
2020-10-19 18:24:09 +00:00
|
|
|
|
2022-04-03 21:18:02 +00:00
|
|
|
Index: acpica-unix2-20220331/source/common/dmtbdump2.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2022-04-03 21:18:02 +00:00
|
|
|
--- acpica-unix2-20220331.orig/source/common/dmtbdump2.c
|
|
|
|
+++ acpica-unix2-20220331/source/common/dmtbdump2.c
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -77,17 +77,20 @@ AcpiDmDumpIort (
|
|
|
|
ACPI_IORT_RMR *IortRmr = NULL;
|
2020-10-19 18:24:09 +00:00
|
|
|
UINT32 Offset;
|
|
|
|
UINT32 NodeOffset;
|
|
|
|
+ UINT32 NodeLength;
|
|
|
|
UINT32 Length;
|
|
|
|
ACPI_DMTABLE_INFO *InfoTable;
|
|
|
|
char *String;
|
|
|
|
UINT32 i;
|
|
|
|
UINT32 MappingByteLength;
|
2021-07-12 03:22:10 +00:00
|
|
|
UINT8 Revision;
|
2020-10-19 18:24:09 +00:00
|
|
|
+ UINT32 MappingCount;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 TableLength = AcpiUtReadUint32 (&Table->Length);
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Main table */
|
|
|
|
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, 0, Table, 0, AcpiDmTableInfoIort);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return;
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -109,18 +112,19 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump the OptionalPadding (optional) */
|
|
|
|
|
|
|
|
- if (Iort->NodeOffset > Offset)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&Iort->NodeOffset);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ if (NodeOffset > Offset)
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset, Table,
|
|
|
|
- Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset, Table,
|
|
|
|
+ NodeOffset - Offset, AcpiDmTableInfoIortPad);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- Offset = Iort->NodeOffset;
|
|
|
|
- while (Offset < Table->Length)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Offset = AcpiUtReadUint32 (&Iort->NodeOffset);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ while (Offset < TableLength)
|
|
|
|
{
|
|
|
|
/* Common subtable header */
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -130,12 +134,12 @@ AcpiDmDumpIort (
|
|
|
|
|
|
|
|
if (Revision == 0)
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
2021-07-12 03:22:10 +00:00
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
IortNode, Length, AcpiDmTableInfoIortHdr);
|
|
|
|
}
|
|
|
|
else if (Revision >= 3)
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset,
|
|
|
|
IortNode, Length, AcpiDmTableInfoIortHdr3);
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -166,7 +170,7 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
|
|
|
|
|
|
|
|
InfoTable = AcpiDmTableInfoIort2;
|
|
|
|
- Length = IortNode->Length - NodeOffset;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
2020-10-19 18:24:09 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_IORT_NODE_SMMU:
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -179,19 +183,19 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
case ACPI_IORT_NODE_SMMU_V3:
|
|
|
|
|
|
|
|
InfoTable = AcpiDmTableInfoIort4;
|
|
|
|
- Length = IortNode->Length - NodeOffset;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
2020-10-19 18:24:09 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_IORT_NODE_PMCG:
|
|
|
|
|
|
|
|
InfoTable = AcpiDmTableInfoIort5;
|
|
|
|
- Length = IortNode->Length - NodeOffset;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
2020-10-19 18:24:09 +00:00
|
|
|
break;
|
|
|
|
|
2021-07-12 03:22:10 +00:00
|
|
|
case ACPI_IORT_NODE_RMR:
|
|
|
|
|
|
|
|
InfoTable = AcpiDmTableInfoIort6;
|
|
|
|
- Length = IortNode->Length - NodeOffset;
|
|
|
|
+ Length = AcpiUtReadUint16 (&IortNode->Length) - NodeOffset;
|
|
|
|
IortRmr = ACPI_ADD_PTR (ACPI_IORT_RMR, IortNode, NodeOffset);
|
|
|
|
break;
|
|
|
|
|
|
|
|
@@ -202,7 +206,7 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Attempt to continue */
|
|
|
|
|
|
|
|
- if (!IortNode->Length)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ if (!AcpiUtReadUint16 (&IortNode->Length))
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
AcpiOsPrintf ("Invalid zero length IORT node\n");
|
|
|
|
return;
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -213,7 +217,7 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Dump the node subtable header */
|
|
|
|
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
Length, InfoTable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -233,9 +237,10 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
if (IortItsGroup)
|
|
|
|
{
|
|
|
|
- for (i = 0; i < IortItsGroup->ItsCount; i++)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 ItsCount = AcpiUtReadUint32 (&IortItsGroup->ItsCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ for (i = 0; i < ItsCount; i++)
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
4, AcpiDmTableInfoIort0a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -252,12 +257,14 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump the Padding (optional) */
|
|
|
|
|
|
|
|
- if (IortNode->Length > NodeOffset)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeLength = AcpiUtReadUint16 (&IortNode->Length);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ if (NodeLength > NodeOffset)
|
|
|
|
{
|
|
|
|
MappingByteLength =
|
|
|
|
- IortNode->MappingCount * sizeof (ACPI_IORT_ID_MAPPING);
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
- Table, IortNode->Length - NodeOffset - MappingByteLength,
|
2021-07-12 03:22:10 +00:00
|
|
|
+ AcpiUtReadUint32 (&IortNode->MappingCount) *
|
2020-10-19 18:24:09 +00:00
|
|
|
+ sizeof (ACPI_IORT_ID_MAPPING);
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
+ Table, NodeLength - NodeOffset - MappingByteLength,
|
|
|
|
AcpiDmTableInfoIort1a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -274,9 +281,11 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
if (IortSmmu)
|
|
|
|
{
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 InterruptCount;
|
2020-10-19 18:24:09 +00:00
|
|
|
+
|
|
|
|
Length = 2 * sizeof (UINT64);
|
|
|
|
- NodeOffset = IortSmmu->GlobalInterruptOffset;
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->GlobalInterruptOffset);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
Length, AcpiDmTableInfoIort3a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -284,10 +293,11 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- NodeOffset = IortSmmu->ContextInterruptOffset;
|
|
|
|
- for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->ContextInterruptOffset);
|
|
|
|
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->ContextInterruptCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ for (i = 0; i < InterruptCount; i++)
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
8, AcpiDmTableInfoIort3b);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -298,10 +308,11 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
NodeOffset += 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
- NodeOffset = IortSmmu->PmuInterruptOffset;
|
|
|
|
- for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&IortSmmu->PmuInterruptOffset);
|
|
|
|
+ InterruptCount = AcpiUtReadUint32 (&IortSmmu->PmuInterruptCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ for (i = 0; i < InterruptCount; i++)
|
|
|
|
{
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
8, AcpiDmTableInfoIort3c);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -319,12 +330,15 @@ AcpiDmDumpIort (
|
|
|
|
/* Validate IortRmr to avoid compiler warnings */
|
|
|
|
if (IortRmr)
|
|
|
|
{
|
|
|
|
- NodeOffset = IortRmr->RmrOffset;
|
|
|
|
+ UINT32 RmrCount;
|
|
|
|
+
|
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&IortRmr->RmrOffset);
|
|
|
|
+ RmrCount = AcpiUtReadUint32 (&IortRmr->RmrCount);
|
|
|
|
Length = sizeof (ACPI_IORT_RMR_DESC);
|
|
|
|
- for (i = 0; i < IortRmr->RmrCount; i++)
|
|
|
|
+ for (i = 0; i < RmrCount; i++)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
Length, AcpiDmTableInfoIort6a);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
@@ -344,12 +358,13 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Dump the ID mappings */
|
|
|
|
|
|
|
|
- NodeOffset = IortNode->MappingOffset;
|
|
|
|
- for (i = 0; i < IortNode->MappingCount; i++)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ NodeOffset = AcpiUtReadUint32 (&IortNode->MappingOffset);
|
|
|
|
+ MappingCount = AcpiUtReadUint32 (&IortNode->MappingCount);
|
2020-10-19 18:24:09 +00:00
|
|
|
+ for (i = 0; i < MappingCount; i++)
|
|
|
|
{
|
|
|
|
AcpiOsPrintf ("\n");
|
|
|
|
Length = sizeof (ACPI_IORT_ID_MAPPING);
|
|
|
|
- Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
|
+ Status = AcpiDmDumpTable (TableLength, Offset + NodeOffset,
|
|
|
|
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
|
Length, AcpiDmTableInfoIortMap);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2021-07-12 03:22:10 +00:00
|
|
|
@@ -363,7 +378,7 @@ AcpiDmDumpIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
NextSubtable:
|
|
|
|
/* Point to next node subtable */
|
|
|
|
|
|
|
|
- Offset += IortNode->Length;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Offset += AcpiUtReadUint16 (&IortNode->Length);
|
2020-10-19 18:24:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-03 21:18:02 +00:00
|
|
|
Index: acpica-unix2-20220331/source/compiler/dttable1.c
|
2020-10-19 18:24:09 +00:00
|
|
|
===================================================================
|
2022-04-03 21:18:02 +00:00
|
|
|
--- acpica-unix2-20220331.orig/source/compiler/dttable1.c
|
|
|
|
+++ acpica-unix2-20220331/source/compiler/dttable1.c
|
|
|
|
@@ -1960,6 +1960,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
ACPI_IORT_ITS_GROUP *IortItsGroup;
|
|
|
|
ACPI_IORT_SMMU *IortSmmu;
|
2021-07-12 03:22:10 +00:00
|
|
|
ACPI_IORT_RMR *IortRmr;
|
2020-10-19 18:24:09 +00:00
|
|
|
+ UINT32 IortNodeOffset;
|
|
|
|
UINT32 NodeNumber;
|
|
|
|
UINT32 NodeLength;
|
|
|
|
UINT32 IdMappingNumber;
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2005,7 +2006,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
* Optionally allows the generic data types to be used for filling
|
|
|
|
* this field.
|
|
|
|
*/
|
|
|
|
- Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
|
|
|
|
+ IortNodeOffset = sizeof (ACPI_TABLE_IORT);
|
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
|
|
|
|
&Subtable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2015,7 +2016,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
if (Subtable)
|
|
|
|
{
|
|
|
|
DtInsertSubtable (ParentTable, Subtable);
|
|
|
|
- Iort->NodeOffset += Subtable->Length;
|
|
|
|
+ IortNodeOffset += Subtable->Length;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2025,7 +2026,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
{
|
|
|
|
return (Status);
|
|
|
|
}
|
|
|
|
- Iort->NodeOffset += PaddingLength;
|
|
|
|
+ IortNodeOffset += PaddingLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
NodeNumber = 0;
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2089,7 +2090,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
ItsNumber++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- IortItsGroup->ItsCount = ItsNumber;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortItsGroup->ItsCount = AcpiUtReadUint32 (&ItsNumber);
|
2020-10-19 18:24:09 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_IORT_NODE_NAMED_COMPONENT:
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2123,15 +2124,18 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
- if (NodeLength > IortNode->MappingOffset)
|
2021-07-12 03:22:10 +00:00
|
|
|
+ UINT32 MappingOffset;
|
2020-10-19 18:24:09 +00:00
|
|
|
+
|
2021-07-12 03:22:10 +00:00
|
|
|
+ MappingOffset = IortNode->MappingOffset;
|
2020-10-19 18:24:09 +00:00
|
|
|
+ if (NodeLength > MappingOffset)
|
|
|
|
{
|
|
|
|
return (AE_BAD_DATA);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (NodeLength < IortNode->MappingOffset)
|
|
|
|
+ if (NodeLength < MappingOffset)
|
|
|
|
{
|
|
|
|
Status = DtCompilePadding (
|
|
|
|
- IortNode->MappingOffset - NodeLength,
|
|
|
|
+ MappingOffset - NodeLength,
|
|
|
|
&Subtable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
|
|
|
{
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2139,7 +2143,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DtInsertSubtable (ParentTable, Subtable);
|
|
|
|
- NodeLength = IortNode->MappingOffset;
|
|
|
|
+ NodeLength = MappingOffset;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2172,7 +2176,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Compile global interrupt array */
|
|
|
|
|
|
|
|
- IortSmmu->GlobalInterruptOffset = NodeLength;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortSmmu->GlobalInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
2020-10-19 18:24:09 +00:00
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
|
|
|
|
&Subtable);
|
|
|
|
if (ACPI_FAILURE (Status))
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2186,7 +2190,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
/* Compile context interrupt array */
|
|
|
|
|
|
|
|
ContextIrptNumber = 0;
|
|
|
|
- IortSmmu->ContextInterruptOffset = NodeLength;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortSmmu->ContextInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
2020-10-19 18:24:09 +00:00
|
|
|
while (*PFieldList)
|
|
|
|
{
|
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2206,12 +2210,12 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
ContextIrptNumber++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- IortSmmu->ContextInterruptCount = ContextIrptNumber;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortSmmu->ContextInterruptCount = AcpiUtReadUint32 (&ContextIrptNumber);
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Compile PMU interrupt array */
|
|
|
|
|
|
|
|
PmuIrptNumber = 0;
|
|
|
|
- IortSmmu->PmuInterruptOffset = NodeLength;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortSmmu->PmuInterruptOffset = AcpiUtReadUint32 (&NodeLength);
|
2020-10-19 18:24:09 +00:00
|
|
|
while (*PFieldList)
|
|
|
|
{
|
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2231,7 +2235,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
PmuIrptNumber++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- IortSmmu->PmuInterruptCount = PmuIrptNumber;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortSmmu->PmuInterruptCount = AcpiUtReadUint32 (&PmuIrptNumber);
|
2020-10-19 18:24:09 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ACPI_IORT_NODE_SMMU_V3:
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2276,7 +2280,7 @@ DtCompileIort (
|
2021-07-12 03:22:10 +00:00
|
|
|
/* Compile RMR Descriptors */
|
|
|
|
|
|
|
|
RmrCount = 0;
|
|
|
|
- IortRmr->RmrOffset = NodeLength;
|
|
|
|
+ IortRmr->RmrOffset = AcpiUtReadUint32 (&NodeLength);
|
|
|
|
while (*PFieldList)
|
|
|
|
{
|
|
|
|
Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort6a,
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2296,7 +2300,7 @@ DtCompileIort (
|
2021-07-12 03:22:10 +00:00
|
|
|
RmrCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- IortRmr->RmrCount = RmrCount;
|
|
|
|
+ IortRmr->RmrCount = AcpiUtReadUint32 (&RmrCount);
|
|
|
|
break;
|
|
|
|
|
2022-04-03 21:18:02 +00:00
|
|
|
default:
|
|
|
|
@@ -2307,7 +2311,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
|
|
|
|
/* Compile Array of ID mappings */
|
|
|
|
|
|
|
|
- IortNode->MappingOffset = NodeLength;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortNode->MappingOffset = AcpiUtReadUint32 (&NodeLength);
|
2020-10-19 18:24:09 +00:00
|
|
|
IdMappingNumber = 0;
|
|
|
|
while (*PFieldList)
|
|
|
|
{
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2328,7 +2332,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
IdMappingNumber++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- IortNode->MappingCount = IdMappingNumber;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ IortNode->MappingCount = AcpiUtReadUint32 (&IdMappingNumber);
|
2020-10-19 18:24:09 +00:00
|
|
|
if (!IdMappingNumber)
|
|
|
|
{
|
|
|
|
IortNode->MappingOffset = 0;
|
2022-04-03 21:18:02 +00:00
|
|
|
@@ -2343,7 +2347,7 @@ DtCompileIort (
|
2020-10-19 18:24:09 +00:00
|
|
|
NodeNumber++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- Iort->NodeCount = NodeNumber;
|
2021-07-12 03:22:10 +00:00
|
|
|
+ Iort->NodeCount = AcpiUtReadUint32 (&NodeNumber);
|
2020-10-19 18:24:09 +00:00
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|