Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/acpica/dist Import acpica 2022-10-20



details:   https://anonhg.NetBSD.org/src/rev/f3f0cd63608b
branches:  trunk
changeset: 372579:f3f0cd63608b
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 10 16:34:37 2022 +0000

description:
Import acpica 2022-10-20

20 October 2022. Summary of changes for version 20221020:

This release is available at https://acpica.org/downloads

0) Global changes:

Allow disabling of -Werror. For distro maintainers having `-Werror`
can delay update of GCC. Since every GCC release might add new
warnings that were not yet captured, it might break the build of
packages. With this change, distros can now build with `NOWERROR=TRUE`
instead of patching either the errors or the makefiles. The default
behavior keeps on using `-Werror`.

1) ACPICA kernel-resident subsystem:

Added support for FFH Operation Region special context data.
FFH(Fixed Function Hardware) Opregion is approved to be added in
ACPI 6.5 via code first approach[1]. It requires special context
data similar to GPIO and Generic Serial Bus as it needs to know
platform specific offset and length.

Reverted this commit "executer/exsystem: Warn about sleeps greater
than 10 ms." Due to user complaints about valid sleeps greater than
10ms seen in some existing machines -- generating lots of warnings.

Do not touch VGA memory when EBDA < 1KiB. The ACPICA code assumes
that EBDA region must be at least 1KiB in size. Because this is
not guaranteed, it might happen that while scanning the memory for
RSDP pointer, the kernel touches memory above 640KiB. This is
unwanted as the VGA memory range may not be decoded or even present
when running under virtualization.

Check that EBDA pointer is in valid memory. If the memory at 0x40e
is uninitialized, the retrieved physical memory address of EBDA
may be beyond the low memory (i.e. above 640K). If so, the kernel
may unintentionally access the VGA memory, that might not be decoded
or even present in case of virtualization.

2) iASL Compiler/Disassembler and ACPICA tools:

Completed the existing partial support for the CDAT "table". Although
this isn't technically an ACPI table (It doesn't go into the XSDT),
it is possible to support this table in the Data Table compiler.
Created one new file, "utilities/utcksum.c", used to centralize
checksum generation/validation into one location. Includes changes
to makefiles and MSVC project files.

Updated support for the IORT table - update to version E.e

Added CXL 3.0 structures (CXIMS & RDPAS) to the CEDT table

iASL: Added CCEL table to both compiler/disassembler.

iASL: NHLT table: Fixed compilation of optional undocumented fields

iASL: Fix iASL compile error due to ACPI_TDEL_OFFSET. Commit #
10e4763 ("iASL: Add CCEL table to both compiler/disassembler")
introduced the iASL build issue. The issue is due to using
ACPI_TDEL_OFFSET for CCEL table member reference. To fix it, change
ACPI_TDEL_OFFSET with ACPI_CCEL_OFFSET.

diffstat:

 sys/external/bsd/acpica/dist/common/acfileio.c                   |  131 ++++-
 sys/external/bsd/acpica/dist/common/adisasm.c                    |    4 +-
 sys/external/bsd/acpica/dist/common/ahtable.c                    |    2 +
 sys/external/bsd/acpica/dist/common/ahuuids.c                    |    3 +
 sys/external/bsd/acpica/dist/common/dmtable.c                    |  116 ++--
 sys/external/bsd/acpica/dist/common/dmtbdump1.c                  |  205 ++++++++-
 sys/external/bsd/acpica/dist/common/dmtbdump2.c                  |  102 +++-
 sys/external/bsd/acpica/dist/common/dmtbinfo1.c                  |  110 ++++
 sys/external/bsd/acpica/dist/common/dmtbinfo2.c                  |   33 +-
 sys/external/bsd/acpica/dist/common/dmtbinfo3.c                  |   17 +
 sys/external/bsd/acpica/dist/compiler/aslcodegen.c               |   75 +++-
 sys/external/bsd/acpica/dist/compiler/aslhelp.c                  |    1 +
 sys/external/bsd/acpica/dist/compiler/aslstartup.c               |    2 +-
 sys/external/bsd/acpica/dist/compiler/dtcompiler.h               |    8 +-
 sys/external/bsd/acpica/dist/compiler/dtio.c                     |    2 +-
 sys/external/bsd/acpica/dist/compiler/dttable1.c                 |  128 +++++-
 sys/external/bsd/acpica/dist/compiler/dttable2.c                 |  177 ++++++-
 sys/external/bsd/acpica/dist/compiler/dttemplate.h               |   63 ++-
 sys/external/bsd/acpica/dist/events/evevent.c                    |   11 +-
 sys/external/bsd/acpica/dist/executer/exfield.c                  |    6 +-
 sys/external/bsd/acpica/dist/executer/exserial.c                 |    6 +
 sys/external/bsd/acpica/dist/generate/release/build.sh           |    2 +-
 sys/external/bsd/acpica/dist/generate/unix/Makefile.config       |    5 +-
 sys/external/bsd/acpica/dist/generate/unix/acpidump/Makefile     |    1 +
 sys/external/bsd/acpica/dist/generate/unix/acpiexamples/Makefile |    1 +
 sys/external/bsd/acpica/dist/generate/unix/acpiexec/Makefile     |    1 +
 sys/external/bsd/acpica/dist/generate/unix/iasl/Makefile         |   23 +-
 sys/external/bsd/acpica/dist/include/acconfig.h                  |    2 +
 sys/external/bsd/acpica/dist/include/actbinfo.h                  |   10 +
 sys/external/bsd/acpica/dist/include/actbl2.h                    |  163 +++++++-
 sys/external/bsd/acpica/dist/include/acuuid.h                    |    3 +-
 sys/external/bsd/acpica/dist/include/platform/acfreebsd.h        |    4 +
 sys/external/bsd/acpica/dist/tables/tbprint.c                    |   90 +---
 sys/external/bsd/acpica/dist/tools/acpidump/apdump.c             |    4 +-
 sys/external/bsd/acpica/dist/tools/acpiexec/aetables.c           |   10 +-
 sys/external/bsd/acpica/dist/tools/acpihelp/ahmain.c             |    2 +-
 sys/external/bsd/acpica/dist/tools/acpisrc/astable.c             |    4 +-
 sys/external/bsd/acpica/dist/tools/examples/extables.c           |    8 +-
 sys/external/bsd/acpica/dist/utilities/utcksum.c                 |  227 ++++++++++
 sys/external/bsd/acpica/dist/utilities/utstring.c                |   10 +-
 40 files changed, 1497 insertions(+), 275 deletions(-)

diffs (truncated from 2896 to 300 lines):

diff -r 46b2ac9a1cf6 -r f3f0cd63608b sys/external/bsd/acpica/dist/common/acfileio.c
--- a/sys/external/bsd/acpica/dist/common/acfileio.c    Sat Dec 10 16:22:21 2022 +0000
+++ b/sys/external/bsd/acpica/dist/common/acfileio.c    Sat Dec 10 16:34:37 2022 +0000
@@ -279,16 +279,36 @@
     ACPI_TABLE_HEADER       TableHeader;
     ACPI_TABLE_HEADER       *Table;
     INT32                   Count;
-    long                    TableOffset;
-
+    UINT32                  TableLength;
+    UINT32                  HeaderLength;
+    long                    TableOffset = 0;
 
     *ReturnTable = NULL;
 
     /* Get the table header to examine signature and length */
+    /*
+     * Special handling for the CDAT table (both the Length field
+     * and the Checksum field are not in the standard positions).
+     * (The table header is non-standard).
+     */
+    if (AcpiGbl_CDAT)
+    {
+        HeaderLength = sizeof (ACPI_TABLE_CDAT);
+    }
+    else
+    {
+        HeaderLength = sizeof (ACPI_TABLE_HEADER);
+    }
+
+    Status = AcValidateTableHeader (File, TableOffset);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
 
     TableOffset = ftell (File);
-    Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File);
-    if (Count != sizeof (ACPI_TABLE_HEADER))
+    Count = fread (&TableHeader, 1, HeaderLength, File);
+    if (Count != (INT32) HeaderLength)
     {
         return (AE_CTRL_TERMINATE);
     }
@@ -297,12 +317,6 @@
     {
         /* Validate the table signature/header (limited ASCII chars) */
 
-        Status = AcValidateTableHeader (File, TableOffset);
-        if (ACPI_FAILURE (Status))
-        {
-            return (Status);
-        }
-
         /*
          * Table must be an AML table (DSDT/SSDT).
          * Used for iASL -e option only.
@@ -317,9 +331,22 @@
         }
     }
 
+    /*
+     * Special handling for the CDAT table (both the Length field
+     * and the Checksum field are not in the standard positions).
+     */
+    if (AcpiGbl_CDAT)
+    {
+        TableLength = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader)->Length;
+    }
+    else
+    {
+        TableLength = TableHeader.Length;
+    }
+
     /* Allocate a buffer for the entire table */
 
-    Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
+    Table = AcpiOsAllocate ((ACPI_SIZE) TableLength);
     if (!Table)
     {
         return (AE_NO_MEMORY);
@@ -328,22 +355,31 @@
     /* Read the entire ACPI table, including header */
 
     fseek (File, TableOffset, SEEK_SET);
-
-    Count = fread (Table, 1, TableHeader.Length, File);
+    Count = fread (Table, 1, TableLength, File);
 
     /*
      * Checks for data table headers happen later in the execution. Only verify
      * for Aml tables at this point in the code.
      */
-    if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length)
+    if (GetOnlyAmlTables && Count != (INT32) TableLength)
     {
         Status = AE_ERROR;
         goto ErrorExit;
     }
 
-    /* Validate the checksum (just issue a warning) */
+    /*
+     * Validate the checksum (just issue a warning if incorrect).
+     * Note: CDAT is special cased here because the table does
+     * not have the checksum field in the standard position.
+     */
+    if (AcpiGbl_CDAT)
+    {
+        Status = AcpiUtVerifyCdatChecksum ((ACPI_TABLE_CDAT *) Table, TableLength);
+    } else
+    {
+        Status = AcpiUtVerifyChecksum (Table, TableLength);
+    }
 
-    Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
     if (ACPI_FAILURE (Status))
     {
         Status = AcCheckTextModeCorruption (Table);
@@ -432,6 +468,8 @@
     long                    TableOffset)
 {
     ACPI_TABLE_HEADER       TableHeader;
+    ACPI_TABLE_CDAT         *CdatTableHeader = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader);
+    UINT32                  HeaderLength;
     ACPI_SIZE               Actual;
     long                    OriginalOffset;
     UINT32                  FileSize;
@@ -440,6 +478,16 @@
 
     ACPI_FUNCTION_TRACE (AcValidateTableHeader);
 
+    /* Determine the type of table header */
+
+    if (AcpiGbl_CDAT)
+    {
+        HeaderLength = sizeof (ACPI_TABLE_CDAT);
+    }
+    else
+    {
+        HeaderLength = sizeof (ACPI_TABLE_HEADER);
+    }
 
     /* Read a potential table header */
 
@@ -448,41 +496,76 @@
     {
         fprintf (stderr, "SEEK error\n");
     }
-    Actual = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File);
+    Actual = fread (&TableHeader, 1, HeaderLength, File);
     if (fseek (File, OriginalOffset, SEEK_SET))
     {
         fprintf (stderr, "SEEK error\n");
     }
 
-    if (Actual < sizeof (ACPI_TABLE_HEADER))
+    if (Actual < HeaderLength)
     {
         fprintf (stderr,
             "Could not read entire table header: Actual %u, Requested %u\n",
-            (UINT32) Actual, (UINT32) sizeof (ACPI_TABLE_HEADER));
+            (UINT32) Actual, HeaderLength);
         return (AE_ERROR);
     }
 
     /* Validate the signature (limited ASCII chars) */
 
-    if (!AcpiUtValidNameseg (TableHeader.Signature))
+    if (!AcpiGbl_CDAT && !AcpiUtValidNameseg (TableHeader.Signature))
     {
+        /*
+         * The "-ds cdat" option was not used, and the signature is not valid.
+         *
+         * For CDAT we are assuming that there should be at least one non-ASCII
+         * byte in the (normally) 4-character Signature field (at least the
+         * high-order byte should be zero). Otherwise, this is OK.
+         */
+        fprintf (stderr,
+            "\nTable appears to be a CDAT table, which has no signature.\n"
+            "If this is in fact a CDAT table, use the -ds option on the\n"
+            "command line to specify the table type (signature):\n"
+            "\"iasl -d -ds CDAT <file>\" or \"iasl -ds CDAT -T CDAT\"\n\n");
+
         return (AE_BAD_SIGNATURE);
     }
 
     /* Validate table length against bytes remaining in the file */
 
     FileSize = CmGetFileSize (File);
-    if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+    if (!AcpiGbl_CDAT)
     {
-        fprintf (stderr, "Table [%4.4s] is too long for file - "
+        /* Standard ACPI table header */
+
+        if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+        {
+            fprintf (stderr, "Table [%4.4s] is too long for file - "
+                "needs: 0x%.2X, remaining in file: 0x%.2X\n",
+                TableHeader.Signature, TableHeader.Length,
+                (UINT32) (FileSize - TableOffset));
+            return (AE_BAD_HEADER);
+        }
+    }
+    else if (CdatTableHeader->Length > (UINT32) (FileSize - TableOffset))
+    {
+        /* Special header for CDAT table */
+
+        fprintf (stderr, "Table [CDAT] is too long for file - "
             "needs: 0x%.2X, remaining in file: 0x%.2X\n",
-            TableHeader.Signature, TableHeader.Length,
+            CdatTableHeader->Length,
             (UINT32) (FileSize - TableOffset));
         return (AE_BAD_HEADER);
     }
 
+    /* For CDAT table, there are no ASCII fields in the header, we are done */
+
+    if (AcpiGbl_CDAT)
+    {
+        return (AE_OK);
+    }
+
     /*
-     * These fields must be ASCII: OemId, OemTableId, AslCompilerId.
+     * These standard fields must be ASCII: OemId, OemTableId, AslCompilerId.
      * We allow a NULL terminator in OemId and OemTableId.
      */
     for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
diff -r 46b2ac9a1cf6 -r f3f0cd63608b sys/external/bsd/acpica/dist/common/adisasm.c
--- a/sys/external/bsd/acpica/dist/common/adisasm.c     Sat Dec 10 16:22:21 2022 +0000
+++ b/sys/external/bsd/acpica/dist/common/adisasm.c     Sat Dec 10 16:34:37 2022 +0000
@@ -368,13 +368,13 @@
         /* This is a "Data Table" (non-AML table) */
 
         AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
-            Table->Signature);
+            AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature);
         AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]  "
             "FieldName : FieldValue (in hex)\n */\n\n");
 
         AcpiDmDumpDataTable (Table);
         fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
-            Table->Signature);
+            AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature);
 
         if (File)
         {
diff -r 46b2ac9a1cf6 -r f3f0cd63608b sys/external/bsd/acpica/dist/common/ahtable.c
--- a/sys/external/bsd/acpica/dist/common/ahtable.c     Sat Dec 10 16:22:21 2022 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahtable.c     Sat Dec 10 16:34:37 2022 +0000
@@ -98,6 +98,8 @@
     {ACPI_SIG_BERT, "Boot Error Record Table"},
     {ACPI_SIG_BGRT, "Boot Graphics Resource Table"},
     {ACPI_SIG_BOOT, "Simple Boot Flag Table"},
+    {ACPI_SIG_CCEL, "CC-Event Log Table"},
+    {ACPI_SIG_CDAT, "Coherent Device Attribute Table"},
     {ACPI_SIG_CEDT, "CXL Early Discovery Table"},
     {ACPI_SIG_CPEP, "Corrected Platform Error Polling Table"},
     {ACPI_SIG_CSRT, "Core System Resource Table"},
diff -r 46b2ac9a1cf6 -r f3f0cd63608b sys/external/bsd/acpica/dist/common/ahuuids.c
--- a/sys/external/bsd/acpica/dist/common/ahuuids.c     Sat Dec 10 16:22:21 2022 +0000
+++ b/sys/external/bsd/acpica/dist/common/ahuuids.c     Sat Dec 10 16:34:37 2022 +0000
@@ -101,6 +101,9 @@
     {"Hierarchical Data Extension", UUID_HIERARCHICAL_DATA_EXTENSION},
     {"ARM Coresight Graph",         UUID_CORESIGHT_GRAPH},
     {"USB4 Capabilities",           UUID_USB4_CAPABILITIES},
+    {"First Function ID for _DSM",  UUID_1ST_FUNCTION_ID},
+    {"Second Function ID for _DSM", UUID_2ND_FUNCTION_ID},
+
     {NULL, NULL}
 };
 
diff -r 46b2ac9a1cf6 -r f3f0cd63608b sys/external/bsd/acpica/dist/common/dmtable.c
--- a/sys/external/bsd/acpica/dist/common/dmtable.c     Sat Dec 10 16:22:21 2022 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtable.c     Sat Dec 10 16:34:37 2022 +0000
@@ -126,6 +126,17 @@
     "Unknown Subtable Type"         /* Reserved */
 };
 
+static const char           *AcpiDmCdatSubnames[] =
+{
+    "Device Scoped Memory Affinity Structure (DSMAS)",
+    "Device scoped Latency and Bandwidth Information Structure (DSLBIS)",
+    "Device Scoped Memory Side Cache Information Structure (DSMSCIS)",
+    "Device Scoped Initiator Structure (DSIS)",
+    "Device Scoped EFI Memory Type Structure (DSEMTS)",
+    "Switch Scoped Latency and Bandwidth Information Structure (SSLBIS)",
+    "Unknown Subtable Type"         /* Reserved */
+};
+
 static const char           *AcpiDmCedtSubnames[] =
 {
     "CXL Host Bridge Structure",
@@ -295,6 +306,13 @@
     "Generic Interrupt Redistributor",  /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
     "Generic Interrupt Translator",     /* ACPI_MADT_GENERIC_TRANSLATOR */
     "Mutiprocessor Wakeup",             /* ACPI_MADT_TYPE_MULTIPROC_WAKEUP */
+    "CPU Core Interrupt Controller",    /* ACPI_MADT_TYPE_CORE_PIC */
+    "Legacy I/O Interrupt Controller",  /* ACPI_MADT_TYPE_LIO_PIC */



Home | Main Index | Thread Index | Old Index