From ed51ccc58008f101f55f23cd37e0b0d9490e0366 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 16 2023 06:22:51 +0000 Subject: import acpica-tools-20180629-5.el8 --- diff --git a/SOURCES/CEDT-support_01.patch b/SOURCES/CEDT-support_01.patch new file mode 100644 index 0000000..8c144aa --- /dev/null +++ b/SOURCES/CEDT-support_01.patch @@ -0,0 +1,179 @@ +commit 0b03aa8ebd7a5b2b9407893f123ee587af45926f +Author: Ben Widawsky +Date: Thu Feb 25 13:54:56 2021 -0800 + + CXL 2.0: CEDT: Add new CEDT table + + This sets up all of the boilerplate without actually doing anything. + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/ahtable.c b/source/common/ahtable.c +index a313c7f..2679fae 100644 +--- a/source/common/ahtable.c ++++ b/source/common/ahtable.c +@@ -95,6 +95,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = + {ACPI_SIG_BERT, "Boot Error Record Table"}, + {ACPI_SIG_BGRT, "Boot Graphics Resource Table"}, + {ACPI_SIG_BOOT, "Simple Boot Flag Table"}, ++ {ACPI_SIG_CEDT, "CXL Early Discovery Table"}, + {ACPI_SIG_CPEP, "Corrected Platform Error Polling table"}, + {ACPI_SIG_CSRT, "Core System Resource Table"}, + {ACPI_SIG_DBG2, "Debug Port table type 2"}, +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 0908e44..137b5b9 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,6 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, ++ {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index 4adb42a..cb41915 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -236,6 +236,33 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = + }; + + ++/******************************************************************************* ++ * ++ * CEDT - CXL Early Discovery Table ++ * ++ ******************************************************************************/ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = ++{ ++ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++/* 0: CXL Host Bridge Structure */ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Uid), "Associated host bridge", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (CxlVersion), "Specification version", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT0_OFFSET (Reserved), "Reserved", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Base), "Register base", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT0_OFFSET (Length), "Register length", 0}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++ + /******************************************************************************* + * + * CPEP - Corrected Platform Error Polling table +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index e9b7a48..5e94ee3 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -256,6 +256,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; +diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h +index 8a1fd74..9735f22 100644 +--- a/source/include/actbinfo.h ++++ b/source/include/actbinfo.h +@@ -104,6 +104,8 @@ + #define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) + #define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) + #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) ++#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) ++#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) + #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) + #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) + #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index b76195f..ce4737d 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -64,6 +64,7 @@ + #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ + #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ + #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ ++#define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */ + #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ + #define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ + #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ +@@ -383,6 +384,56 @@ typedef struct acpi_table_boot + + } ACPI_TABLE_BOOT; + ++/******************************************************************************* ++ * ++ * CEDT - CXL Early Discovery Table ++ * Version 1 ++ * ++ * Conforms to the "CXL Early Discovery Table" (CXL 2.0) ++ * ++ ******************************************************************************/ ++ ++typedef struct acpi_table_cedt ++{ ++ ACPI_TABLE_HEADER Header; /* Common ACPI table header */ ++ ++} ACPI_TABLE_CEDT; ++ ++/* CEDT subtable header (Performance Record Structure) */ ++ ++typedef struct acpi_cedt_header ++{ ++ UINT8 Type; ++ UINT8 Reserved; ++ UINT16 Length; ++ ++} ACPI_CEDT_HEADER; ++ ++/* Values for Type field above */ ++ ++enum AcpiCedtType ++{ ++ ACPI_CEDT_TYPE_CHBS = 0, ++}; ++ ++ ++/* ++ * CEDT subtables ++ */ ++ ++/* 0: CXL Host Bridge Structure */ ++ ++typedef struct acpi_cedt_chbs ++{ ++ ACPI_CEDT_HEADER Header; ++ UINT32 Uid; ++ UINT32 CxlVersion; ++ UINT32 Reserved; ++ UINT64 Base; ++ UINT64 Length; ++ ++} ACPI_CEDT_CHBS; ++ + + /******************************************************************************* + * +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index ef74f17..8aa35fe 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -529,6 +529,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_BERT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT}, ++ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, diff --git a/SOURCES/CEDT-support_02.patch b/SOURCES/CEDT-support_02.patch new file mode 100644 index 0000000..586dabb --- /dev/null +++ b/SOURCES/CEDT-support_02.patch @@ -0,0 +1,123 @@ +commit b980be9b7fd364f62f62655e458325581a4f239c +Author: Ben Widawsky +Date: Thu Feb 25 14:11:46 2021 -0800 + + CXL 2.0: CEDT: Add table and subtable dumping + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 137b5b9..f483a78 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, NULL, NULL, NULL}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 0103a6c..19a810f 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -221,6 +221,82 @@ AcpiDmDumpAsf ( + } + } + ++/******************************************************************************* ++ * ++ * FUNCTION: AcpiDmDumpCedt ++ * ++ * PARAMETERS: Table - A CEDT table ++ * ++ * RETURN: None ++ * ++ * DESCRIPTION: Format the contents of a CEDT. This table type consists ++ * of an open-ended number of subtables. ++ * ++ ******************************************************************************/ ++ ++void ++AcpiDmDumpCedt ( ++ ACPI_TABLE_HEADER *Table) ++{ ++ ACPI_STATUS Status; ++ ACPI_CEDT_HEADER *Subtable; ++ UINT32 Length = Table->Length; ++ UINT32 Offset = sizeof (ACPI_TABLE_CEDT); ++ ACPI_DMTABLE_INFO *InfoTable; ++ ++ ++ /* There is no main table (other than the standard ACPI header) */ ++ ++ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset); ++ while (Offset < Table->Length) ++ { ++ /* Common subtable header */ ++ ++ AcpiOsPrintf ("\n"); ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedtHdr); ++ if (ACPI_FAILURE (Status)) ++ { ++ return; ++ } ++ ++ switch (Subtable->Type) ++ { ++ case ACPI_CEDT_TYPE_CHBS: ++ ++ InfoTable = AcpiDmTableInfoCedt0; ++ break; ++ ++ default: ++ ++ AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", ++ Subtable->Type); ++ ++ /* Attempt to continue */ ++ ++ if (!Subtable->Length) ++ { ++ AcpiOsPrintf ("Invalid zero length subtable\n"); ++ return; ++ } ++ goto NextSubtable; ++ } ++ ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, InfoTable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return; ++ } ++ ++NextSubtable: ++ /* Point to next subtable */ ++ ++ Offset += Subtable->Length; ++ Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, ++ Subtable->Length); ++ } ++} + + /******************************************************************************* + * +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index 5e94ee3..d7f348f 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -533,6 +533,10 @@ void + AcpiDmDumpAsf ( + ACPI_TABLE_HEADER *Table); + ++void ++AcpiDmDumpCedt ( ++ ACPI_TABLE_HEADER *Table); ++ + void + AcpiDmDumpCpep ( + ACPI_TABLE_HEADER *Table); diff --git a/SOURCES/CEDT-support_03.patch b/SOURCES/CEDT-support_03.patch new file mode 100644 index 0000000..3082e60 --- /dev/null +++ b/SOURCES/CEDT-support_03.patch @@ -0,0 +1,58 @@ +commit 187e2f286f503cce9f57748da639dfccaeaecf96 +Author: Ben Widawsky +Date: Thu Feb 25 14:19:51 2021 -0800 + + CXL 2.0: CEDT: Add template + + Signed-off-by: Ben Widawsky + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index f483a78..5b204a8 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -376,7 +376,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, NULL}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h +index 5136f75..fd20109 100644 +--- a/source/compiler/dtcompiler.h ++++ b/source/compiler/dtcompiler.h +@@ -587,6 +587,7 @@ extern const unsigned char TemplateAsf[]; + extern const unsigned char TemplateBoot[]; + extern const unsigned char TemplateBert[]; + extern const unsigned char TemplateBgrt[]; ++extern const unsigned char TemplateCedt[]; + extern const unsigned char TemplateCpep[]; + extern const unsigned char TemplateCsrt[]; + extern const unsigned char TemplateDbg2[]; +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index e3fbd8b..275003c 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -96,6 +96,20 @@ const unsigned char TemplateBoot[] = + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ + }; + ++const unsigned char TemplateCedt[] = ++{ ++ /* FIXME: This is from QEMU */ ++ 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */ ++ 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */ ++ 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */ ++ 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */ ++ 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */ ++ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */ ++ 0x00,0x00,0x00,0x00 /* 00000040 "...." */ ++}; ++ + const unsigned char TemplateCpep[] = + { + 0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */ diff --git a/SOURCES/CEDT-support_04.patch b/SOURCES/CEDT-support_04.patch new file mode 100644 index 0000000..d6f6154 --- /dev/null +++ b/SOURCES/CEDT-support_04.patch @@ -0,0 +1,278 @@ +commit 1e6dded267b13c4aa0c3e16de0fa89d3b9c880e9 +Author: Robert Moore +Date: Thu Mar 11 13:12:08 2021 -0800 + + iASL/TableCompiler: Add compilation support for CEDT table. + Also, update the CEDT template. + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 5b204a8..530e872 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -76,6 +76,12 @@ static const char *AcpiDmAsfSubnames[] = + "Unknown Subtable Type" /* Reserved */ + }; + ++static const char *AcpiDmCedtSubnames[] = ++{ ++ "CXL Host Bridge Structure", ++ "Unknown Subtable Type" /* Reserved */ ++}; ++ + static const char *AcpiDmDmarSubnames[] = + { + "Hardware Unit Definition", +@@ -376,7 +382,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert}, + {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot}, +- {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, NULL, TemplateCedt}, ++ {ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep}, + {ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt}, + {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2}, +@@ -830,6 +836,7 @@ AcpiDmDumpTable ( + case ACPI_DMT_CHKSUM: + case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: ++ case ACPI_DMT_CEDT: + case ACPI_DMT_IVRS: + case ACPI_DMT_GTDT: + case ACPI_DMT_MADT: +@@ -1240,6 +1247,20 @@ AcpiDmDumpTable ( + AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]); + break; + ++ case ACPI_DMT_CEDT: ++ ++ /* CEDT subtable types */ ++ ++ Temp8 = *Target; ++ if (Temp8 > ACPI_CEDT_TYPE_RESERVED) ++ { ++ Temp8 = ACPI_CEDT_TYPE_RESERVED; ++ } ++ ++ AcpiOsPrintf (UINT8_FORMAT, *Target, ++ AcpiDmCedtSubnames[Temp8]); ++ break; ++ + case ACPI_DMT_DMAR: + + /* DMAR subtable types */ +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index cb41915..fb1c19a 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -244,7 +244,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] = + + ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[] = + { +- {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, ++ {ACPI_DMT_CEDT, ACPI_CEDT_OFFSET (Type), "Subtable Type", 0}, + {ACPI_DMT_UINT8, ACPI_CEDT_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_CEDT_OFFSET (Length), "Length", DT_LENGTH}, + ACPI_DMT_TERMINATOR +diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h +index fd20109..9a78519 100644 +--- a/source/compiler/dtcompiler.h ++++ b/source/compiler/dtcompiler.h +@@ -419,6 +419,10 @@ ACPI_STATUS + DtCompileCpep ( + void **PFieldList); + ++ACPI_STATUS ++DtCompileCedt ( ++ void **PFieldList); ++ + ACPI_STATUS + DtCompileCsrt ( + void **PFieldList); +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 24d33c1..a3240f8 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -234,6 +234,80 @@ DtCompileAsf ( + } + + ++/****************************************************************************** ++ * ++ * FUNCTION: DtCompileCedt ++ * ++ * PARAMETERS: List - Current field list pointer ++ * ++ * RETURN: Status ++ * ++ * DESCRIPTION: Compile CEDT. ++ * ++ *****************************************************************************/ ++ ++ACPI_STATUS ++DtCompileCedt ( ++ void **List) ++{ ++ ACPI_STATUS Status; ++ DT_SUBTABLE *Subtable; ++ DT_SUBTABLE *ParentTable; ++ DT_FIELD **PFieldList = (DT_FIELD **) List; ++ ACPI_CEDT_HEADER *CedtHeader; ++ DT_FIELD *SubtableStart; ++ ++ ++ /* Walk the parse tree */ ++ ++ while (*PFieldList) ++ { ++ SubtableStart = *PFieldList; ++ ++ /* CEDT Header */ ++ ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedtHdr, ++ &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); ++ DtPushSubtable (Subtable); ++ ++ CedtHeader = ACPI_CAST_PTR (ACPI_CEDT_HEADER, Subtable->Buffer); ++ ++ switch (CedtHeader->Type) ++ { ++ case ACPI_CEDT_TYPE_CHBS: ++ ++ break; ++ ++ default: ++ ++ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); ++ return (AE_ERROR); ++ } ++ ++ /* CEDT Subtable */ ++ ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); ++ DtPopSubtable (); ++ } ++ ++ return (AE_OK); ++} ++ ++ + /****************************************************************************** + * + * FUNCTION: DtCompileCpep +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index 275003c..82f352a 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -98,16 +98,23 @@ const unsigned char TemplateBoot[] = + + const unsigned char TemplateCedt[] = + { +- /* FIXME: This is from QEMU */ +- 0x43,0x45,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "CEDTD..." */ +- 0x01,0x3E,0x42,0x4F,0x43,0x48,0x53,0x20, /* 00000008 ".>BOCHS " */ +- 0x42,0x58,0x50,0x43,0x20,0x20,0x20,0x20, /* 00000010 "BXPC " */ +- 0x01,0x00,0x00,0x00,0x42,0x58,0x50,0x43, /* 00000018 "....BXPC" */ +- 0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000020 "...... ." */ +- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */ +- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0, /* 00000030 "........" */ +- 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000038 "........" */ +- 0x00,0x00,0x00,0x00 /* 00000040 "...." */ ++ 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */ ++ 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ ++ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ ++ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ ++ 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ ++ 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ ++ 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ ++ 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */ ++ 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */ ++ 0x00,0x00,0x00,0x00 /* 00000080 "...." */ + }; + + const unsigned char TemplateCpep[] = +diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c +index 658726b..a5ef782 100644 +--- a/source/compiler/dtutils.c ++++ b/source/compiler/dtutils.c +@@ -455,6 +455,7 @@ DtGetFieldLength ( + case ACPI_DMT_CHKSUM: + case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: ++ case ACPI_DMT_CEDT: + case ACPI_DMT_IVRS: + case ACPI_DMT_GTDT: + case ACPI_DMT_MADT: +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index d7f348f..f50adef 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -143,6 +143,7 @@ typedef enum + /* Types that are specific to particular ACPI tables */ + + ACPI_DMT_ASF, ++ ACPI_DMT_CEDT, + ACPI_DMT_DMAR, + ACPI_DMT_DMAR_SCOPE, + ACPI_DMT_EINJACT, +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index ce4737d..a551303 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -384,6 +384,7 @@ typedef struct acpi_table_boot + + } ACPI_TABLE_BOOT; + ++ + /******************************************************************************* + * + * CEDT - CXL Early Discovery Table +@@ -414,6 +415,7 @@ typedef struct acpi_cedt_header + enum AcpiCedtType + { + ACPI_CEDT_TYPE_CHBS = 0, ++ ACPI_CEDT_TYPE_RESERVED = 1 + }; + + +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index 8aa35fe..5fc0ab5 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -534,6 +534,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT}, ++ {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT}, +@@ -592,6 +593,8 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_ASF_REMOTE", SRC_TYPE_STRUCT}, + {"ACPI_ASF_RMCP", SRC_TYPE_STRUCT}, + {"ACPI_BERT_REGION", SRC_TYPE_STRUCT}, ++ {"ACPI_CEDT_CHBS", SRC_TYPE_STRUCT}, ++ {"ACPI_CEDT_HEADER", SRC_TYPE_STRUCT}, + {"ACPI_CPEP_POLLING", SRC_TYPE_STRUCT}, + {"ACPI_CSRT_GROUP", SRC_TYPE_STRUCT}, + {"ACPI_CSRT_DESCRIPTOR", SRC_TYPE_STRUCT}, diff --git a/SOURCES/CEDT-support_05.patch b/SOURCES/CEDT-support_05.patch new file mode 100644 index 0000000..41e14c0 --- /dev/null +++ b/SOURCES/CEDT-support_05.patch @@ -0,0 +1,31 @@ +commit 5ace82441a34f8d45725f12f6bd2677e79c186a6 +Author: Alison Schofield +Date: Thu May 20 13:33:02 2021 -0700 + + Add defines for the CXL Host Bridge Structure (CHBS) + + CXL 2.0 defines length and version field values for the CHBS. + Include them in the ACPI CEDT table definition. + + Signed-off-by: Alison Schofield + +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index a551303..51fee30 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -418,6 +418,15 @@ enum AcpiCedtType + ACPI_CEDT_TYPE_RESERVED = 1 + }; + ++/* Values for version field above */ ++ ++#define ACPI_CEDT_CHBS_VERSION_CXL11 (0) ++#define ACPI_CEDT_CHBS_VERSION_CXL20 (1) ++ ++/* Values for length field above */ ++ ++#define ACPI_CEDT_CHBS_LENGTH_CXL11 (0x2000) ++#define ACPI_CEDT_CHBS_LENGTH_CXL20 (0x10000) + + /* + * CEDT subtables diff --git a/SOURCES/CEDT-support_06.patch b/SOURCES/CEDT-support_06.patch new file mode 100644 index 0000000..79e2bfd --- /dev/null +++ b/SOURCES/CEDT-support_06.patch @@ -0,0 +1,66 @@ +commit 699fc72e56936bebf3b9ba39b6e91bd957b44452 +Author: Alison Schofield +Date: Thu May 20 13:48:40 2021 -0700 + + Add the CFMWS structure definition to the CEDT table + + The CXL Fixed Memory Window Structure (CFMWS) is added to the + CXL Early Discovery Table (CEDT). This new structure is defined + in an ECN to the CXL 2.0 specification. + + https://www.computeexpresslink.org/spec-landing + + Signed-off-by: Alison Schofield + +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index 51fee30..f274a85 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -415,7 +415,8 @@ typedef struct acpi_cedt_header + enum AcpiCedtType + { + ACPI_CEDT_TYPE_CHBS = 0, +- ACPI_CEDT_TYPE_RESERVED = 1 ++ ACPI_CEDT_TYPE_CFMWS = 1, ++ ACPI_CEDT_TYPE_RESERVED = 2, + }; + + /* Values for version field above */ +@@ -446,6 +447,37 @@ typedef struct acpi_cedt_chbs + } ACPI_CEDT_CHBS; + + ++/* 1: CXL Fixed Memory Window Structure */ ++ ++typedef struct acpi_cedt_cfmws ++{ ++ ACPI_CEDT_HEADER Header; ++ UINT32 Reserved1; ++ UINT64 BaseHpa; ++ UINT64 WindowSize; ++ UINT8 InterleaveWays; ++ UINT8 InterleaveArithmetic; ++ UINT16 Reserved2; ++ UINT32 Granularity; ++ UINT16 Restrictions; ++ UINT16 QtgId; ++ UINT32 InterleaveTargets[]; ++ ++} ACPI_CEDT_CFMWS; ++ ++/* Values for Interleave Arithmetic field above */ ++ ++#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) ++ ++/* Values for Restrictions field above */ ++ ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) ++#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) ++#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) ++#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) ++ ++ + /******************************************************************************* + * + * CPEP - Corrected Platform Error Polling table (ACPI 4.0) diff --git a/SOURCES/CEDT-support_07.patch b/SOURCES/CEDT-support_07.patch new file mode 100644 index 0000000..70e482f --- /dev/null +++ b/SOURCES/CEDT-support_07.patch @@ -0,0 +1,20 @@ +commit ec39d05939c799dc1a3635c766805924afdbbe9e +Author: Erik Kaneda +Date: Tue Jun 1 10:37:51 2021 -0700 + + Disassembler: add missing strings to decode subtable types + + Signed-off-by: Erik Kaneda + +diff --git a/source/common/dmtable.c b/source/common/dmtable.c +index 530e872..14aa927 100644 +--- a/source/common/dmtable.c ++++ b/source/common/dmtable.c +@@ -79,6 +79,7 @@ static const char *AcpiDmAsfSubnames[] = + static const char *AcpiDmCedtSubnames[] = + { + "CXL Host Bridge Structure", ++ "CXL Fixed Memory Window Structure", + "Unknown Subtable Type" /* Reserved */ + }; + diff --git a/SOURCES/CEDT-support_08.patch b/SOURCES/CEDT-support_08.patch new file mode 100644 index 0000000..511d9ae --- /dev/null +++ b/SOURCES/CEDT-support_08.patch @@ -0,0 +1,184 @@ +commit 19b11f91660b1a38a8e9655b0b1a4ad51ec4db1e +Author: Lawrence Hileman +Date: Fri Jan 7 16:33:40 2022 -0800 + + Add the subtable CFMWS to the CEDT table + +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 19a810f..597bb3b 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -242,7 +242,6 @@ AcpiDmDumpCedt ( + ACPI_CEDT_HEADER *Subtable; + UINT32 Length = Table->Length; + UINT32 Offset = sizeof (ACPI_TABLE_CEDT); +- ACPI_DMTABLE_INFO *InfoTable; + + + /* There is no main table (other than the standard ACPI header) */ +@@ -263,35 +262,50 @@ AcpiDmDumpCedt ( + switch (Subtable->Type) + { + case ACPI_CEDT_TYPE_CHBS: ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedt0); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } ++ break; ++ ++ case ACPI_CEDT_TYPE_CFMWS: { ++ ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; ++ unsigned int i, max = 0x01 << (ptr->InterleaveWays); ++ ++ // print out table with first "Interleave target" ++ Status = AcpiDmDumpTable (Length, Offset, Subtable, ++ Subtable->Length, AcpiDmTableInfoCedt1); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } + +- InfoTable = AcpiDmTableInfoCedt0; ++ // Now, print out any interleave targets beyond the first. ++ for (i = 1; i < max; i++) { ++ unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); ++ unsigned int *trg = &(ptr->InterleaveTargets[i]); ++ Status = AcpiDmDumpTable (Length, loc_offset, trg, ++ Subtable->Length, AcpiDmTableInfoCedt1_te); ++ if (ACPI_FAILURE (Status)) { ++ return; ++ } ++ } + break; ++ } + + default: +- + AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n", + Subtable->Type); + + /* Attempt to continue */ +- + if (!Subtable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } +- goto NextSubtable; +- } +- +- Status = AcpiDmDumpTable (Length, Offset, Subtable, +- Subtable->Length, InfoTable); +- if (ACPI_FAILURE (Status)) +- { +- return; + } + +-NextSubtable: + /* Point to next subtable */ +- + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable, + Subtable->Length); +diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c +index fb1c19a..9fbb8fa 100644 +--- a/source/common/dmtbinfo1.c ++++ b/source/common/dmtbinfo1.c +@@ -262,6 +262,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[] = + ACPI_DMT_TERMINATOR + }; + ++/* 1: CXL Fixed Memory Window Structure */ ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Reserved1), "Reserved", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (BaseHpa), "Window base address", 0}, ++ {ACPI_DMT_UINT64, ACPI_CEDT1_OFFSET (WindowSize), "Window size", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveWays), "Interleave Members (2^n)", 0}, ++ {ACPI_DMT_UINT8, ACPI_CEDT1_OFFSET (InterleaveArithmetic), "Interleave Arithmetic", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Reserved2), "Reserved", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (Granularity), "Granularity", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (Restrictions), "Restrictions", 0}, ++ {ACPI_DMT_UINT16, ACPI_CEDT1_OFFSET (QtgId), "QtgId", 0}, ++ {ACPI_DMT_UINT32, ACPI_CEDT1_OFFSET (InterleaveTargets), "First Target", 0}, ++ ACPI_DMT_TERMINATOR ++}; ++ ++ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[] = ++{ ++ {ACPI_DMT_UINT32, ACPI_CEDT1_TE_OFFSET (InterleaveTarget), "Next Target", 0}, ++ ACPI_DMT_TERMINATOR ++}; + + /******************************************************************************* + * +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index a3240f8..79550ab 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -282,18 +282,18 @@ DtCompileCedt ( + switch (CedtHeader->Type) + { + case ACPI_CEDT_TYPE_CHBS: +- ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ break; ++ case ACPI_CEDT_TYPE_CFMWS: ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); + break; + + default: +- + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); + return (AE_ERROR); + } + + /* CEDT Subtable */ +- +- Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); +diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h +index f50adef..233cef0 100644 +--- a/source/include/acdisasm.h ++++ b/source/include/acdisasm.h +@@ -259,6 +259,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[]; ++extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1_te[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; + extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; +diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h +index 9735f22..91a3d2e 100644 +--- a/source/include/actbinfo.h ++++ b/source/include/actbinfo.h +@@ -106,6 +106,8 @@ + #define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) + #define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f) + #define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f) ++#define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f) ++#define ACPI_CEDT1_TE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS_TARGET_ELEMENT, f) + #define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) + #define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f) + #define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f) +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index f274a85..3c46b60 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -465,6 +465,11 @@ typedef struct acpi_cedt_cfmws + + } ACPI_CEDT_CFMWS; + ++typedef struct acpi_cedt_cfmws_target_element ++{ ++ UINT32 InterleaveTarget; ++} ACPI_CEDT_CFMWS_TARGET_ELEMENT; ++ + /* Values for Interleave Arithmetic field above */ + + #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) diff --git a/SOURCES/CEDT-support_09.patch b/SOURCES/CEDT-support_09.patch new file mode 100644 index 0000000..fe2a73a --- /dev/null +++ b/SOURCES/CEDT-support_09.patch @@ -0,0 +1,173 @@ +commit d9798f5275bb20ab88ac854ba04e6e3bdb22cf6d +Author: Lawrence Hileman +Date: Mon Jan 17 15:24:34 2022 -0800 + + Fix Compile issue with CEDT and add template + +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 79550ab..6eea2a4 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -262,6 +262,7 @@ DtCompileCedt ( + + while (*PFieldList) + { ++ int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later + SubtableStart = *PFieldList; + + /* CEDT Header */ +@@ -283,24 +284,68 @@ DtCompileCedt ( + { + case ACPI_CEDT_TYPE_CHBS: + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt0, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } + break; +- case ACPI_CEDT_TYPE_CFMWS: ++ case ACPI_CEDT_TYPE_CFMWS: { ++ unsigned char *dump; ++ unsigned int idx, offset, max = 0; ++ ++ // Compile table with first "Interleave target" + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ ++ // Look in buffer for the number of targets ++ offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); ++ dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1 ++ max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX ++ if (max > 8) max=1; // Error in encoding Interleaving Ways. ++ if (max == 1) // if only one target, then break here. ++ break; // break if only one target. ++ ++ // We need to add more interleave targets, so write the current Subtable. ++ ParentTable = DtPeekSubtable (); ++ DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in ++ DtPushSubtable (Subtable); // the targets > the first. ++ ++ // Now, find out all interleave targets beyond the first. ++ for (idx = 1; idx < max; idx++) { ++ ParentTable = DtPeekSubtable (); ++ ++ if (*PFieldList) ++ { ++ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1_te, &Subtable); ++ if (ACPI_FAILURE (Status)) ++ { ++ return (Status); ++ } ++ if (Subtable) ++ { ++ DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table. ++ InsertFlag = 0; ++ } ++ } ++ } ++ ++ DtPopSubtable (); ++ ParentTable = DtPeekSubtable (); + break; ++ } + + default: + DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CEDT"); + return (AE_ERROR); + } + +- /* CEDT Subtable */ +- if (ACPI_FAILURE (Status)) +- { +- return (Status); +- } +- + ParentTable = DtPeekSubtable (); +- DtInsertSubtable (ParentTable, Subtable); ++ if (InsertFlag == 1) { ++ DtInsertSubtable (ParentTable, Subtable); ++ } + DtPopSubtable (); + } + +diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h +index 82f352a..ceddb93 100644 +--- a/source/compiler/dttemplate.h ++++ b/source/compiler/dttemplate.h +@@ -98,23 +98,58 @@ const unsigned char TemplateBoot[] = + + const unsigned char TemplateCedt[] = + { +- 0x43,0x45,0x44,0x54,0x84,0x00,0x00,0x00, /* 00000000 "CEDT...." */ +- 0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ +- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ +- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ +- 0x05,0x01,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ +- 0x33,0x33,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000028 "33......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xD5, /* 00000030 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0x01,0x00, /* 00000038 "....E#.." */ ++ 0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */ ++ 0x01,0x87,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 "..INTEL " */ ++ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ ++ 0x00,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */ ++ 0x17,0x12,0x21,0x20,0x00,0x00,0x20,0x00, /* 00000020 "..! .. ." */ ++ 0x00,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000028 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000030 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000038 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000040 "...... ." */ +- 0x44,0x44,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000048 "DD......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xA5, /* 00000050 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000058 "....E#.." */ ++ 0x01,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000050 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000058 "..... .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000060 "...... ." */ +- 0x55,0x55,0xCD,0xAB,0x01,0x00,0x00,0x00, /* 00000068 "UU......" */ +- 0x00,0x00,0x00,0x00,0x00,0x21,0x43,0xB5, /* 00000070 ".....!C." */ +- 0x00,0x00,0x00,0x00,0x45,0x23,0xB1,0x00, /* 00000078 "....E#.." */ +- 0x00,0x00,0x00,0x00 /* 00000080 "...." */ ++ 0x02,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000068 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00, /* 00000070 ".....0.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000078 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, /* 00000080 "...... ." */ ++ 0x03,0x5e,0xba,0x00,0x00,0x00,0x00,0x00, /* 00000088 ".^......" */ ++ 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, /* 00000090 ".....@.." */ ++ 0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00, /* 00000098 "..... .." */ ++ 0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x00, /* 000000a0 "......(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b0 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000c0 "........" */ ++ 0x00,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000c8 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 000000e8 "........" */ ++ 0x01,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 000000f0 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000110 "........" */ ++ 0x02,0x5e,0xba,0x00,0x01,0x00,0x28,0x00, /* 00000118 ".^....(." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ ++ 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000138 "........" */ ++ 0x03,0x5e,0xba,0x00,0x01,0x00,0x2c,0x00, /* 00000140 ".^....,." */ ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ ++ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ ++ 0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000158 "........" */ ++ 0x03,0x00,0x00,0x00,0x06,0x00,0x01,0x00, /* 00000160 "........" */ ++ 0x00,0x5e,0xba,0x00,0x01,0x5e,0xba,0x00, /* 00000160 ".^...^.." */ ++ 0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x00, /* 00000170 "..,....." */ ++ 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00, /* 00000178 "........" */ ++ 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, /* 00000180 "........" */ ++ 0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00, /* 00000188 "........" */ ++ 0x0a,0x00,0x01,0x00,0x02,0x5e,0xba,0x00, /* 00000190 ".....^.." */ ++ 0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */ + }; + + const unsigned char TemplateCpep[] = diff --git a/SOURCES/CEDT-support_10.patch b/SOURCES/CEDT-support_10.patch new file mode 100644 index 0000000..4db7970 --- /dev/null +++ b/SOURCES/CEDT-support_10.patch @@ -0,0 +1,127 @@ +commit 0914618b553d6f3366e568409cebf2656891ca69 +Author: Robert Moore +Date: Thu Feb 17 14:24:24 2022 -0800 + + Automated cleanup; No functional changes + Removed some tabs and // comments. + +diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c +index 597bb3b..76662a4 100644 +--- a/source/common/dmtbdump1.c ++++ b/source/common/dmtbdump1.c +@@ -273,14 +273,16 @@ AcpiDmDumpCedt ( + ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable; + unsigned int i, max = 0x01 << (ptr->InterleaveWays); + +- // print out table with first "Interleave target" ++ /* print out table with first "Interleave target" */ ++ + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCedt1); + if (ACPI_FAILURE (Status)) { + return; + } + +- // Now, print out any interleave targets beyond the first. ++ /* Now, print out any interleave targets beyond the first. */ ++ + for (i = 1; i < max; i++) { + unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets); + unsigned int *trg = &(ptr->InterleaveTargets[i]); +diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c +index 6eea2a4..e2e0379 100644 +--- a/source/compiler/dttable1.c ++++ b/source/compiler/dttable1.c +@@ -262,7 +262,9 @@ DtCompileCedt ( + + while (*PFieldList) + { +- int InsertFlag = 1; // if CFMWS and has more than one target, then set to zero later ++ /* if CFMWS and has more than one target, then set to zero later */ ++ ++ int InsertFlag = 1; + SubtableStart = *PFieldList; + + /* CEDT Header */ +@@ -293,27 +295,30 @@ DtCompileCedt ( + unsigned char *dump; + unsigned int idx, offset, max = 0; + +- // Compile table with first "Interleave target" ++ /* Compile table with first "Interleave target" */ ++ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoCedt1, &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + +- // Look in buffer for the number of targets ++ /* Look in buffer for the number of targets */ + offset = (unsigned int) ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveWays); +- dump = (unsigned char *) Subtable->Buffer - 4; // place at beginning of cedt1 +- max = 0x01 << dump[offset]; // 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX +- if (max > 8) max=1; // Error in encoding Interleaving Ways. +- if (max == 1) // if only one target, then break here. +- break; // break if only one target. ++ dump = (unsigned char *) Subtable->Buffer - 4; /* place at beginning of cedt1 */ ++ max = 0x01 << dump[offset]; /* 2^max, so 0=1, 1=2, 2=4, 3=8. 8 is MAX */ ++ if (max > 8) max=1; /* Error in encoding Interleaving Ways. */ ++ if (max == 1) /* if only one target, then break here. */ ++ break; /* break if only one target. */ ++ ++ /* We need to add more interleave targets, so write the current Subtable. */ + +- // We need to add more interleave targets, so write the current Subtable. + ParentTable = DtPeekSubtable (); +- DtInsertSubtable (ParentTable, Subtable); // Insert AcpiDmTableInfoCedt1 table so we can put in +- DtPushSubtable (Subtable); // the targets > the first. ++ DtInsertSubtable (ParentTable, Subtable); /* Insert AcpiDmTableInfoCedt1 table so we can put in */ ++ DtPushSubtable (Subtable); /* the targets > the first. */ ++ ++ /* Now, find out all interleave targets beyond the first. */ + +- // Now, find out all interleave targets beyond the first. + for (idx = 1; idx < max; idx++) { + ParentTable = DtPeekSubtable (); + +@@ -326,7 +331,7 @@ DtCompileCedt ( + } + if (Subtable) + { +- DtInsertSubtable (ParentTable, Subtable); // got a target, so insert table. ++ DtInsertSubtable (ParentTable, Subtable); /* got a target, so insert table. */ + InsertFlag = 0; + } + } +diff --git a/source/include/actbl1.h b/source/include/actbl1.h +index 3c46b60..b291aa2 100644 +--- a/source/include/actbl1.h ++++ b/source/include/actbl1.h +@@ -468,19 +468,20 @@ typedef struct acpi_cedt_cfmws + typedef struct acpi_cedt_cfmws_target_element + { + UINT32 InterleaveTarget; ++ + } ACPI_CEDT_CFMWS_TARGET_ELEMENT; + + /* Values for Interleave Arithmetic field above */ + +-#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) ++#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0) + + /* Values for Restrictions field above */ + +-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) +-#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) +-#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) +-#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) +-#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE2 (1) ++#define ACPI_CEDT_CFMWS_RESTRICT_TYPE3 (1<<1) ++#define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE (1<<2) ++#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3) ++#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4) + + + /******************************************************************************* diff --git a/SOURCES/CEDT-support_11.patch b/SOURCES/CEDT-support_11.patch new file mode 100644 index 0000000..0198da8 --- /dev/null +++ b/SOURCES/CEDT-support_11.patch @@ -0,0 +1,18 @@ +commit 7021087eedb0d7156286e9e4f255e93c07816921 +Author: Robert Moore +Date: Fri Aug 26 12:20:07 2022 -0700 + + Remove a duplicate of ACPI_SIG_CEDT + +diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c +index 5fc0ab5..2946e0d 100644 +--- a/source/tools/acpisrc/astable.c ++++ b/source/tools/acpisrc/astable.c +@@ -534,7 +534,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = { + {"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT}, +- {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT}, + {"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT}, diff --git a/SPECS/acpica-tools.spec b/SPECS/acpica-tools.spec index 6554190..67ea959 100644 --- a/SPECS/acpica-tools.spec +++ b/SPECS/acpica-tools.spec @@ -1,6 +1,6 @@ Name: acpica-tools Version: 20180629 -Release: 3%{?dist} +Release: 5%{?dist} Summary: ACPICA tools for the development and debug of ACPI tables Group: Development/Languages @@ -42,8 +42,19 @@ Patch13: cve-2017-13693.patch Patch14: cve-2017-13694.patch Patch15: cve-2017-13695.patch Patch16: str-trunc-warn.patch -Patch17: ptr-cast.patch -Patch18: aslcodegen.patch +Patch17: ptr-cast.patch +Patch18: aslcodegen.patch +Patch19: CEDT-support_01.patch +Patch20: CEDT-support_02.patch +Patch21: CEDT-support_03.patch +Patch22: CEDT-support_04.patch +Patch23: CEDT-support_05.patch +Patch24: CEDT-support_06.patch +Patch25: CEDT-support_07.patch +Patch26: CEDT-support_08.patch +Patch27: CEDT-support_09.patch +Patch28: CEDT-support_10.patch +Patch29: CEDT-support_11.patch BuildRequires: bison patchutils flex gcc @@ -93,25 +104,7 @@ This version of the tools is being released under GPLv2 license. %setup -q -n acpica-unix2-%{version} gzip -dc %{SOURCE1} | tar -x --strip-components=1 -f - -%patch0 -p1 -b .big-endian -%patch1 -p1 -b .unaligned -%patch2 -p1 -b .OPT_LDFLAGS -%patch3 -p1 -b .int-format -%patch4 -p1 -b .f23-harden -%patch5 -p1 -b .template -%patch6 -p1 -b .free -%patch7 -p1 -b .ppc64le -%patch8 -p1 -b .arm7hl -%patch9 -p1 -b .big-endian-v2 -%patch10 -p1 -b .simple-64bit -%patch11 -p1 -b .be-tpm2 -%patch12 -p1 -b .mips-be-fix -%patch13 -p1 -b .cve-2017-13693 -%patch14 -p1 -b .cve-2017-13694 -%patch15 -p1 -b .cve-2017-13695 -%patch16 -p1 -b .str-trunc-warn -%patch17 -p1 -b .ptr-cast -%patch18 -p1 -b .aslcodegen +%autopatch -p1 cp -p %{SOURCE2} README.Fedora cp -p %{SOURCE3} iasl.1 @@ -240,6 +233,24 @@ fi %changelog +* Thu Oct 06 2022 Dean Nelson - 20180629-5 +- Switch to using '%%autopatch -p1' and eliminate long list of '%%patch -p1 -b '. +- Backport 0b03aa8ebd7a ("CXL 2.0: CEDT: Add new CEDT table"). +- Backport b980be9b7fd3 ("CXL 2.0: CEDT: Add table and subtable dumping"). +- Backport 187e2f286f50 ("CXL 2.0: CEDT: Add template"). +- Backport 1e6dded267b1 ("iASL/TableCompiler: Add compilation support for CEDT table."). +- Backport 5ace82441a34 ("Add defines for the CXL Host Bridge Structure (CHBS)"). +- Backport 699fc72e5693 ("Add the CFMWS structure definition to the CEDT table"). +- Backport ec39d05939c7 ("Disassembler: add missing strings to decode subtable types"). +- Backport 19b11f91660b ("Add the subtable CFMWS to the CEDT table"). +- Backport d9798f5275bb ("Fix Compile issue with CEDT and add template"). +- Backport 0914618b553d ("Automated cleanup; No functional changes"). +- Backport 7021087eedb0 ("Remove a duplicate of ACPI_SIG_CEDT"). + +* Mon Aug 19 2019 Al Stone - 20180629-4 +- Add in OSCI testing to the build +- Resolves: rhbz#1682381 + * Wed Aug 8 2018 Al Stone - 20180629-3 - Add in man page for acpiexamples. So that the man page makes some sense, also copy the source code used for acpiexamples to the doc directory for