Skip to content

Commit

Permalink
ACPI 6.0: Add changes for IORT and DRTM tables.
Browse files Browse the repository at this point in the history
Individual patch descriptions (8):

Using a minus number with ACPI_ADD_PTR() will cause compiler warnings, such
warnings cannot be eliminated by force casting an unsigned value to a
signed value. This patch thus introduces ACPI_SUB_PTR() to be used with
minus numbers. Lv Zheng.

In CSRT/DBG2, there is ACPI_DMT_BUFFER defined for the variable length
fields and the support around such variable length fields is broken:
1. CSRT cannot compile "ResourceInfo" buffer.
2. There is an extra empty line appended before such fields.
3. CSRT contains broken subtable length fields due to this variable length
   field.
4. Code in CSRT support doesn't manage "parent table", "sub-table"
   correctly.

This patch fixes CSRT/DBG2 table decompilation/compilation issues using new
ACPI_DMT_RAW_BUFFER. Since there is no user of the MultiLine parameter,
this patch also removes it from AcpiDmDumpBuffer(). Also this patch
enhances AcpiDmDumpBuffer() to allow small sized buffer to be dumped to the
same line as its header to ensure no user experience regression. Lv Zheng.

This patch adds support for IORT (IO Remapping Table) in iasl.

Note that some field names are modified to shrink their length or the
decompiled IORT ASL will contain fields with ugly ":" alignment.

This patch doesn't add inline table support for the SMMU interrupt fields
and memroy access properties fields. They will be added by seperate
patches. Lv Zheng.

The IORT contains field definitions around "Memory Access Properties".

This patch adds support to encode/decode it using inline table. Lv Zheng.

Some data tables reserve fields for future extension. So we need to compile
the higher versioning table's fields using generic compiling betwee the
known field names.

This patch adds support to allow optional fields insertion. Lv Zheng.

This patch implements OptionalPadding in a different way so that newer
versioned IORT can be written with the generic data types to generate the
"OptionalPadding" field. Lv Zheng.

This patch implements Padding in a different way so that users can specify
an offset in the "Offset to ID mappings" field to determine the length of
the "Padding" field. Lv Zheng.

This patch adds support for DRTM (Dynamic Root of Trust for Measurement
table) in iasl. Lv Zheng.
  • Loading branch information
acpibob committed May 1, 2015
1 parent 02cbb41 commit 5de8275
Show file tree
Hide file tree
Showing 14 changed files with 1,445 additions and 55 deletions.
24 changes: 22 additions & 2 deletions source/common/dmtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2, "Debug Port table type 2"},
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
{ACPI_SIG_DRTM, NULL, AcpiDmDumpDrtm, DtCompileDrtm, TemplateDrtm, "Dynamic Root of Trust for Measurement table"},
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"},
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
Expand All @@ -397,6 +398,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IORT, NULL, AcpiDmDumpIort, DtCompileIort, TemplateIort, "IO Remapping Table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
{ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"},
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
Expand Down Expand Up @@ -927,6 +929,15 @@ AcpiDmDumpTable (
ByteLength = sizeof (ACPI_HEST_NOTIFY);
break;

case ACPI_DMT_IORTMEM:

if (!LastOutputBlankLine)
{
LastOutputBlankLine = FALSE;
}
ByteLength = sizeof (ACPI_IORT_MEMORY_ACCESS);
break;

default:

ByteLength = 0;
Expand Down Expand Up @@ -1309,6 +1320,16 @@ AcpiDmDumpTable (
AcpiDmHestNotifySubnames[Temp8]);
break;

case ACPI_DMT_IORTMEM:

AcpiOsPrintf (STRING_FORMAT,
"IORT Memory Access Properties");

AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_IORT_MEMORY_ACCESS), AcpiDmTableInfoIortAcc);
LastOutputBlankLine = TRUE;
break;

case ACPI_DMT_MADT:

/* MADT subtable types */
Expand Down Expand Up @@ -1371,8 +1392,7 @@ AcpiDmDumpTable (
}

AcpiDmDumpBuffer (Table, CurrentOffset, ByteLength,
CurrentOffset, NULL, TRUE);
AcpiOsPrintf ("\n");
CurrentOffset, NULL);
break;

case ACPI_DMT_SRAT:
Expand Down
Loading

0 comments on commit 5de8275

Please sign in to comment.