Skip to content

Commit b5daf67

Browse files
committed
acpica: Merge ACPICA 20250807
Merge commit '5bb60d44e94172a567412968545c82065695d871'
2 parents b03f765 + 5bb60d4 commit b5daf67

File tree

28 files changed

+280
-85
lines changed

28 files changed

+280
-85
lines changed

sys/contrib/dev/acpica/changes.txt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
----------------------------------------
2+
7 August 2025. Summary of changes for version 20250807:
3+
4+
Major changes:
5+
6+
Added option to skip the global lock for SMM - Huacai Chen
7+
8+
Fixed non-NUL terminated string implementations - Ahmed Salem
9+
10+
Fixed CCEL and CDAT templates - Ahmed Salem
11+
12+
Fixed a major Linux kernel bug (UAF) that was triggered by unequal number of method parameters (definition) vs arguments (invocation) in different places - Peter Williams, Hans de Goede, Rafael Wysocki
13+
14+
Define distinct D3 states (D3Hot and D3Cold) that help clarify the device behavior support - Aymeric Wibo
15+
16+
A few cleanups, improvements to existing table supports, small fixes, spelling corrections etc.
17+
18+
119
----------------------------------------
220
4 April 2025. Summary of changes for version 20250404:
321

422
Major changes:
523

624
Update all the copyright continuation year to 2025 in the license header of all files
725

8-
Add complete support for 3 new ACPI tables ? MRRM,ERDT and RIMT (Tony Luck & V L Sunil)
26+
Add complete support for 3 new ACPI tables - MRRM,ERDT and RIMT (Tony Luck & V L Sunil)
927

1028
Add a license file to the project which is a great improvement (Dionna Glaze)
1129

@@ -21,11 +39,11 @@ Major changes:
2139

2240
Fix 2 critical CVE addressing memory leaks - Seunghun Han
2341

24-
EINJ V2 updates ? Zaid Alali (Ampere Computing)
42+
EINJ V2 updates - Zaid Alali (Ampere Computing)
2543

26-
CDAT updates ? Ira Weiny (Intel Corporation)
44+
CDAT updates - Ira Weiny (Intel Corporation)
2745

28-
Fix mutex handling, don?t release ones that were never acquired ? Daniil Tatianin
46+
Fix mutex handling, do not release ones that were never acquired - Daniil Tatianin
2947

3048
Experiment with new tag name format Ryyyy_mm_dd to solve chronological sorting problems
3149

@@ -39,7 +57,7 @@ Fix the acpixf.h file which caused issues for the last release (before this) 202
3957

4058
Fix the pointer offset for the SLIC table
4159

42-
Verify the local environment and GitHub commits are all in sync which was a problem with the second from last release (before this)20240322 (aka 20240323 date issue)
60+
Verify the local environment and GitHub commits are all in sync which was a problem with the second from last release (before this)20240322 (aka 20240323 - date issue)
4361

4462

4563

sys/contrib/dev/acpica/common/adisasm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,12 @@ AdDisassembleOneTable (
481481
"FieldName : FieldValue (in hex)\n */\n\n");
482482

483483
AcpiDmDumpDataTable (Table);
484-
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
484+
fprintf (stdout, "Acpi Data Table [%4.4s] decoded\n",
485485
AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature);
486486

487487
if (File)
488488
{
489-
fprintf (stderr, "Formatted output: %s - %u bytes\n",
489+
fprintf (stdout, "Formatted output: %s - %u bytes\n",
490490
DisasmFilename, CmGetFileSize (File));
491491
}
492492

@@ -584,16 +584,16 @@ AdDisassembleOneTable (
584584

585585
AcpiDmDumpDataTable (Table);
586586

587-
fprintf (stderr, "Disassembly completed\n");
587+
fprintf (stdout, "Disassembly completed\n");
588588
if (File)
589589
{
590-
fprintf (stderr, "ASL Output: %s - %u bytes\n",
590+
fprintf (stdout, "ASL Output: %s - %u bytes\n",
591591
DisasmFilename, CmGetFileSize (File));
592592
}
593593

594594
if (AslGbl_MapfileFlag)
595595
{
596-
fprintf (stderr, "%14s %s - %u bytes\n",
596+
fprintf (stdout, "%14s %s - %u bytes\n",
597597
AslGbl_FileDescs[ASL_FILE_MAP_OUTPUT].ShortDescription,
598598
AslGbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
599599
FlGetFileSize (ASL_FILE_MAP_OUTPUT));
@@ -630,7 +630,7 @@ AdReparseOneTable (
630630
ACPI_COMMENT_ADDR_NODE *AddrListHead;
631631

632632

633-
fprintf (stderr,
633+
fprintf (stdout,
634634
"\nFound %u external control methods, "
635635
"reparsing with new information\n",
636636
AcpiDmGetUnresolvedExternalMethodCount ());

sys/contrib/dev/acpica/common/ahtable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ const AH_TABLE AcpiGbl_SupportedTables[] =
265265
{ACPI_SIG_SSDT, "Secondary System Description Table (AML table)"},
266266
{ACPI_SIG_STAO, "Status Override Table"},
267267
{ACPI_SIG_SVKL, "Storage Volume Key Location Table"},
268+
{ACPI_SIG_SWFT, "SoundWire File Table"},
268269
{ACPI_SIG_TCPA, "Trusted Computing Platform Alliance Table"},
269270
{ACPI_SIG_TDEL, "TD-Event Log Table"},
270271
{ACPI_SIG_TPM2, "Trusted Platform Module hardware interface Table"},

sys/contrib/dev/acpica/common/dmtable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
721721
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat},
722722
{ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao},
723723
{ACPI_SIG_SVKL, AcpiDmTableInfoSvkl, AcpiDmDumpSvkl, DtCompileSvkl, TemplateSvkl},
724+
{ACPI_SIG_SWFT, NULL, NULL, NULL, NULL},
724725
{ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa},
725726
{ACPI_SIG_TDEL, AcpiDmTableInfoTdel, NULL, NULL, TemplateTdel},
726727
{ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2},

sys/contrib/dev/acpica/common/dmtbdump2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ AcpiDmDumpRhct (
26372637
RhctIsaString, RhctIsaString->IsaLength, AcpiDmTableInfoRhctIsa1);
26382638
if (Subtable->Length > IsaPadOffset)
26392639
{
2640-
Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
2640+
Status = AcpiDmDumpTable (Table->Length, Offset + IsaPadOffset,
26412641
ACPI_ADD_PTR (UINT8, Subtable, IsaPadOffset),
26422642
(Subtable->Length - IsaPadOffset), AcpiDmTableInfoRhctIsaPad);
26432643
}

sys/contrib/dev/acpica/common/dmtbinfo2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRhct[] =
21802180
ACPI_DMTABLE_INFO AcpiDmTableInfoRhctNodeHdr[] =
21812181
{
21822182
{ACPI_DMT_RHCT, ACPI_RHCTH_OFFSET (Type), "Subtable Type", 0},
2183-
{ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Length), "Length", 0},
2183+
{ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Length), "Length", DT_LENGTH},
21842184
{ACPI_DMT_UINT16, ACPI_RHCTH_OFFSET (Revision), "Revision", 0},
21852185
ACPI_DMT_TERMINATOR
21862186
};

sys/contrib/dev/acpica/common/dmtbinfo3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCcel[] =
200200
{
201201
{ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCType), "CC Type", 0},
202202
{ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCSubType), "CC Sub Type", 0},
203-
{ACPI_DMT_UINT32, ACPI_CCEL_OFFSET (Reserved), "Reserved", 0},
203+
{ACPI_DMT_UINT16, ACPI_CCEL_OFFSET (Reserved), "Reserved", 0},
204204
{ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaMinimumLength), "Log Area Minimum Length", 0},
205205
{ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaStartAddress), "Log Area Start Address", 0},
206206
ACPI_DMT_TERMINATOR

sys/contrib/dev/acpica/compiler/aslanalyze.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,22 @@ ApCheckForGpeNameConflict (
572572
ACPI_PARSE_OBJECT *NextOp;
573573
UINT32 GpeNumber;
574574
char Name[ACPI_NAMESEG_SIZE + 1];
575-
char Target[ACPI_NAMESEG_SIZE];
575+
char Target[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
576576

577577

578-
/* Need a null-terminated string version of NameSeg */
578+
/**
579+
* Need a null-terminated string version of NameSeg
580+
*
581+
* NOTE: during a review on Name[ACPI_NAMESEG_SIZE + 1] having an extra
582+
* byte[1], compiler testing exhibited a difference in behavior between
583+
* GCC and Clang[2] (at least; MSVC may also exhibit the same) in
584+
* how optimization is done. The extra byte is needed to ensure
585+
* the signature does not get mangled, subsequently avoiding
586+
* GpeNumber being a completely different return value from strtoul.
587+
*
588+
* [1] https://github.com/acpica/acpica/pull/1019#discussion_r2058687704
589+
* [2] https://github.com/acpica/acpica/pull/1019#discussion_r2061953039
590+
*/
579591

580592
ACPI_MOVE_32_TO_32 (Name, Op->Asl.NameSeg);
581593
Name[ACPI_NAMESEG_SIZE] = 0;

sys/contrib/dev/acpica/compiler/aslrestype2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ RsDoCsi2SerialBusDescriptor (
14691469

14701470
case 2: /* Local Port Instance [Integer] (_PRT) */
14711471

1472-
RsSetFlagBits16 ((UINT16 *) &Descriptor->Csi2SerialBus.TypeSpecificFlags, InitializerOp, 0, 0);
1472+
RsSetFlagBits16 ((UINT16 *) &Descriptor->Csi2SerialBus.TypeSpecificFlags, InitializerOp, 2, 0);
14731473
RsCreateMultiBitField (InitializerOp, ACPI_RESTAG_LOCALPORT,
14741474
CurrentByteOffset + ASL_RESDESC_OFFSET (Csi2SerialBus.TypeSpecificFlags), 2, 6);
14751475
break;

sys/contrib/dev/acpica/compiler/dttable2.c

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,24 +1929,30 @@ DtCompileRhct (
19291929
{
19301930
ACPI_STATUS Status;
19311931
ACPI_RHCT_NODE_HEADER *RhctHeader;
1932-
ACPI_RHCT_HART_INFO *RhctHartInfo = NULL;
1932+
ACPI_RHCT_HART_INFO *RhctHartInfo;
19331933
DT_SUBTABLE *Subtable;
19341934
DT_SUBTABLE *ParentTable;
19351935
ACPI_DMTABLE_INFO *InfoTable;
19361936
DT_FIELD **PFieldList = (DT_FIELD **) List;
19371937
DT_FIELD *SubtableStart;
1938+
ACPI_TABLE_RHCT *Table;
1939+
BOOLEAN FirstNode = TRUE;
19381940

19391941

19401942
/* Compile the main table */
19411943

1944+
ParentTable = DtPeekSubtable ();
19421945
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRhct,
19431946
&Subtable);
19441947
if (ACPI_FAILURE (Status))
19451948
{
19461949
return (Status);
19471950
}
1951+
DtInsertSubtable (ParentTable, Subtable);
1952+
Table = ACPI_CAST_PTR (ACPI_TABLE_RHCT, ParentTable->Buffer);
1953+
Table->NodeCount = 0;
1954+
Table->NodeOffset = sizeof (ACPI_TABLE_RHCT);
19481955

1949-
ParentTable = DtPeekSubtable ();
19501956
while (*PFieldList)
19511957
{
19521958
SubtableStart = *PFieldList;
@@ -1961,7 +1967,10 @@ DtCompileRhct (
19611967
}
19621968
DtInsertSubtable (ParentTable, Subtable);
19631969
RhctHeader = ACPI_CAST_PTR (ACPI_RHCT_NODE_HEADER, Subtable->Buffer);
1964-
RhctHeader->Length = (UINT16)(Subtable->Length);
1970+
1971+
DtPushSubtable (Subtable);
1972+
ParentTable = DtPeekSubtable ();
1973+
Table->NodeCount++;
19651974

19661975
switch (RhctHeader->Type)
19671976
{
@@ -1999,44 +2008,64 @@ DtCompileRhct (
19992008
return (Status);
20002009
}
20012010
DtInsertSubtable (ParentTable, Subtable);
2002-
RhctHeader->Length += (UINT16)(Subtable->Length);
2011+
if (FirstNode)
2012+
{
2013+
Table->NodeOffset = ACPI_PTR_DIFF(ParentTable->Buffer, Table);
2014+
FirstNode = FALSE;
2015+
}
20032016

20042017
/* Compile RHCT subtable additionals */
20052018

20062019
switch (RhctHeader->Type)
20072020
{
2008-
case ACPI_RHCT_NODE_TYPE_HART_INFO:
2021+
case ACPI_RHCT_NODE_TYPE_ISA_STRING:
20092022

2010-
RhctHartInfo = ACPI_SUB_PTR (ACPI_RHCT_HART_INFO,
2011-
Subtable->Buffer, sizeof (ACPI_RHCT_NODE_HEADER));
2012-
if (RhctHartInfo)
2023+
/*
2024+
* Padding - Variable-length data
2025+
* Optionally allows the padding of the ISA string to be used
2026+
* for filling this field.
2027+
*/
2028+
Status = DtCompileTable (PFieldList, AcpiDmTableInfoRhctIsaPad,
2029+
&Subtable);
2030+
if (ACPI_FAILURE (Status))
2031+
{
2032+
return (Status);
2033+
}
2034+
if (Subtable)
20132035
{
2036+
DtInsertSubtable (ParentTable, Subtable);
2037+
}
2038+
break;
20142039

2015-
RhctHartInfo->NumOffsets = 0;
2016-
while (*PFieldList)
2017-
{
2018-
Status = DtCompileTable (PFieldList,
2019-
AcpiDmTableInfoRhctHartInfo2, &Subtable);
2020-
if (ACPI_FAILURE (Status))
2021-
{
2022-
return (Status);
2023-
}
2024-
if (!Subtable)
2025-
{
2026-
break;
2027-
}
2040+
case ACPI_RHCT_NODE_TYPE_HART_INFO:
20282041

2029-
DtInsertSubtable (ParentTable, Subtable);
2030-
RhctHeader->Length += (UINT16)(Subtable->Length);
2031-
RhctHartInfo->NumOffsets++;
2042+
RhctHartInfo = ACPI_CAST_PTR (ACPI_RHCT_HART_INFO,
2043+
Subtable->Buffer);
2044+
RhctHartInfo->NumOffsets = 0;
2045+
while (*PFieldList)
2046+
{
2047+
Status = DtCompileTable (PFieldList,
2048+
AcpiDmTableInfoRhctHartInfo2, &Subtable);
2049+
if (ACPI_FAILURE (Status))
2050+
{
2051+
return (Status);
20322052
}
2053+
if (!Subtable)
2054+
{
2055+
break;
2056+
}
2057+
DtInsertSubtable (ParentTable, Subtable);
2058+
RhctHartInfo->NumOffsets++;
20332059
}
20342060
break;
20352061

20362062
default:
20372063

20382064
break;
20392065
}
2066+
2067+
DtPopSubtable ();
2068+
ParentTable = DtPeekSubtable ();
20402069
}
20412070

20422071
return (AE_OK);

0 commit comments

Comments
 (0)