From 3ccfccfec1fe9280ae17e878fe817a69dfa886f5 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Tue, 27 Jul 2021 16:47:53 -0600 Subject: [PATCH] Running 'iasl -T all' would segfault Dumping all the templates worked fine until the PHAT dump, which caused the segfault; removing extraneous assignments from big-endian patch for the table fixes the problem. Signed-off-by: Al Stone --- 0046-Support-PHAT-in-a-big-endian-world.patch | 15 +++++++-------- acpica-tools.spec | 6 +++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/0046-Support-PHAT-in-a-big-endian-world.patch b/0046-Support-PHAT-in-a-big-endian-world.patch index 973286b..011e519 100644 --- a/0046-Support-PHAT-in-a-big-endian-world.patch +++ b/0046-Support-PHAT-in-a-big-endian-world.patch @@ -13,14 +13,15 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c =================================================================== --- acpica-unix2-20210604.orig/source/common/dmtbdump2.c +++ acpica-unix2-20210604/source/common/dmtbdump2.c -@@ -1573,39 +1573,43 @@ AcpiDmDumpPhat ( +@@ -1573,39 +1573,41 @@ AcpiDmDumpPhat ( ACPI_PHAT_HEADER *Subtable; ACPI_PHAT_VERSION_DATA *VersionData; UINT32 RecordCount; - UINT32 Length = Table->Length; + UINT32 TableLength = AcpiUtReadUint32 (&Table->Length); UINT32 Offset = sizeof (ACPI_TABLE_PHAT); - UINT32 SubtableLength; +- UINT32 SubtableLength; ++ UINT16 SubtableLength; UINT32 PathLength; UINT32 VendorLength; + UINT16 SubtableType; @@ -34,9 +35,7 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c /* Common subtable header */ + SubtableType = AcpiUtReadUint16 (&Subtable->Type); -+ Subtable->Type = SubtableType; + SubtableLength = AcpiUtReadUint16 (&Subtable->Length); -+ Subtable->Length = SubtableLength; + AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, 0, Subtable, @@ -63,7 +62,7 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c break; default: -@@ -1616,22 +1620,22 @@ AcpiDmDumpPhat ( +@@ -1616,22 +1618,22 @@ AcpiDmDumpPhat ( return; } @@ -90,7 +89,7 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_VERSION_DATA)), sizeof (ACPI_PHAT_VERSION_ELEMENT), AcpiDmTableInfoPhat0a); if (ACPI_FAILURE (Status)) -@@ -1649,7 +1653,7 @@ AcpiDmDumpPhat ( +@@ -1649,7 +1651,7 @@ AcpiDmDumpPhat ( /* account for the null terminator */ PathLength = strlen (ACPI_ADD_PTR (char, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA))) + 1; @@ -99,7 +98,7 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)), PathLength, AcpiDmTableInfoPhat1a); if (ACPI_FAILURE (Status)) -@@ -1660,8 +1664,8 @@ AcpiDmDumpPhat ( +@@ -1660,8 +1662,8 @@ AcpiDmDumpPhat ( /* Get vendor data - data length is the remaining subtable length */ VendorLength = @@ -110,7 +109,7 @@ Index: acpica-unix2-20210604/source/common/dmtbdump2.c ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength), VendorLength, AcpiDmTableInfoPhat1b); if (ACPI_FAILURE (Status)) -@@ -1673,15 +1677,15 @@ AcpiDmDumpPhat ( +@@ -1673,15 +1675,15 @@ AcpiDmDumpPhat ( default: AcpiOsPrintf ("\n**** Unknown PHAT subtable type 0x%X\n\n", diff --git a/acpica-tools.spec b/acpica-tools.spec index 23d867a..be43d74 100644 --- a/acpica-tools.spec +++ b/acpica-tools.spec @@ -1,6 +1,6 @@ Name: acpica-tools Version: 20210604 -Release: 2%{?dist} +Release: 3%{?dist} Summary: ACPICA tools for the development and debug of ACPI tables License: GPLv2 @@ -254,6 +254,10 @@ fi %changelog +* Tue Jul 27 2021 Al Stone - 20210604-3 +- Running 'iasl -T all' would segfault when dumping the PHAT template; + fixed AcpiDmDumpPhat() by removing unnecessary assignments from patch + * Wed Jul 21 2021 Fedora Release Engineering - 20210604-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild