Skip to content

Commit 3702a51

Browse files
committed
Merge tag 'acpi-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "The most significant part of these changes is an ACPICA update covering two upstream ACPICA releases, 20241212 and 20250404, that have not been included into the kernel code base yet. Among other things, it adds definitions needed to address GCC 15's -Wunterminated-string-initialization warnings, adds support for three new tables (MRRM, ERDT, RIMT), extends support for two tables (RAS2, DMAR), and fixes some issues. On top of the above, there is a new parser for the MRRM table, more changes related to GCC 15's -Wunterminated-string-initialization warnings, a CPPC library update including functions related to autonomous CPU performance state selection, a couple of new quirks, some assorted fixes and some code cleanups. Specifics: - Fix two ACPICA SLAB cache leaks (Seunghun Han) - Add EINJv2 get error type action and define Error Injection Actions in hex values to avoid inconsistencies between the specification and the code (Zaid Alali) - Fix typo in comments for SRAT structures (Adam Lackorzynski) - Prevent possible loss of data in ACPICA because of u32 to u8 conversions (Saket Dumbre) - Fix reading FFixedHW operation regions in ACPICA (Daniil Tatianin) - Add support for printing AML arguments when the ACPICA debug level is ACPI_LV_TRACE_POINT (Mario Limonciello) - Drop a stale comment about the file content from actbl2.h (Sudeep Holla) - Apply pack(1) to union aml_resource (Tamir Duberstein) - Fix overflow check in the ACPICA version of vsnprintf() (gldrk) - Interpret SIDP structures in DMAR added revision 3.4 of the VT-d specification (Alexey Neyman) - Add typedef and other definitions related to MRRM to ACPICA (Tony Luck) - Add definitions for RIMT to ACPICA (Sunil V L) - Fix spelling mistake "Incremement" -> "Increment" in the ACPICA utilities code (Colin Ian King) - Add typedef and other definitions for ERDT to ACPICA (Tony Luck) - Introduce ACPI_NONSTRING and use it (Kees Cook, Ahmed Salem) - Rename structure and field names of the RAS2 table in actbl2.h (Shiju Jose) - Fix up whitespace in acpica/utcache.c (Zhe Qiao) - Avoid sequence overread in a call to strncmp() in ap_get_table_length() and replace strncpy() with memcpy() in ACPICA in some places (Ahmed Salem) - Update copyright year in all ACPICA files (Saket Dumbre) - Add __nonstring annotations for unterminated strings in the static ACPI tables parsing code (Kees Cook) - Add support for parsing the MRRM ACPI table and sysfs files to describe memory regions listed in it (Tony Luck, Anil Keshavamurthy) - Remove an (explicitly) unused header file include from the VIOT ACPI table parser file (Andy Shevchenko) - Improve logging around acpi_initialize_tables() (Bartosz Szczepanek) - Clean up the initialization of CPU data structures in the ACPI processor driver (Zhang Rui) - Remove an obsolete comment regarding the C-states handling in the ACPI processor driver (Giovanni Gherdovich) - Simplify PCC shared memory region handling (Sudeep Holla) - Rework and extend functions for reading CPPC register values and for updating CPPC registers (Lifeng Zheng) - Add three functions related to autonomous CPU performance state selection to the CPPC library (Lifeng Zheng) - Turn the acpi_pci_root_remap_iospace() fwnode_handle parameter into a const pointer (Pei Xiao) - Round battery capacity percengate in the ACPI battery driver to the closest integer to avoid user confusion (shitao) - Make the ACPI battery driver report the current as a negative number to the power supply framework when the battery is discharging as documented (Peter Marheine) - Add TUXEDO InfinityBook Pro AMD Gen9 to the acpi_ec_no_wakeup[] list to prevent spurious wakeups from suspend-to-idle (Werner Sembach) - Convert the APEI EINJ driver to a faux device one (Sudeep Holla, Jon Hunter) - Remove redundant calls to einj_get_available_error_type() from the APEI EINJ driver (Zaid Alali) - Fix a typo for MECHREVO in irq1_edge_low_force_override[] (Mingcong Bai) - Add an LPS0 check() callback to the AMD pinctrl driver and fix up config symbol dependencies in it (Mario Limonciello, Rafael Wysocki) - Avoid initializing the ACPI platform profile driver on non-ACPI platforms (Alexandre Ghiti) - Document that references to ACPI data (non-device) nodes should use string-only references in hierarchical data node packages (Sakari Ailus) - Fail the ACPI bus registration if acpi_kobj registration fails (Armin Wolf)" * tag 'acpi-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits) ACPI: MRRM: Fix default max memory region ACPI: bus: Bail out if acpi_kobj registration fails ACPI: platform_profile: Avoid initializing on non-ACPI platforms pinctrl: amd: Fix hibernation support with CONFIG_SUSPEND unset ACPI: tables: Improve logging around acpi_initialize_tables() ACPI: VIOT: Remove (explicitly) unused header ACPI: Add documentation for exposing MRRM data ACPI: MRRM: Add /sys files to describe memory ranges ACPI: MRRM: Minimal parse of ACPI MRRM table ACPICA: Update copyright year ACPICA: Logfile: Changes for version 20250404 ACPICA: Replace strncpy() with memcpy() ACPICA: Apply ACPI_NONSTRING in more places ACPICA: Avoid sequence overread in call to strncmp() ACPICA: Adjust the position of code lines ACPICA: actbl2.h: ACPI 6.5: RAS2: Rename structure and field names of the RAS2 table ACPICA: Apply ACPI_NONSTRING ACPICA: Introduce ACPI_NONSTRING ACPICA: actbl2.h: ERDT: Add typedef and other definitions ACPICA: infrastructure: Add new DMT_BUF types and shorten a long name ...
2 parents 0492948 + db0e4d5 commit 3702a51

File tree

208 files changed

+1252
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+1252
-553
lines changed

Documentation/ABI/testing/sysfs-firmware-acpi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,24 @@ Description:
248248
# cat ff_pwr_btn
249249
7 enabled
250250

251+
What: /sys/firmware/acpi/memory_ranges/rangeX
252+
Date: February 2025
253+
Contact: Tony Luck <tony.luck@intel.com>
254+
Description:
255+
On systems with the ACPI MRRM table reports the parameters for
256+
each range.
257+
258+
base: Starting system physical address.
259+
260+
length: Length of this range in bytes.
261+
262+
node: NUMA node that this range belongs to. Negative numbers
263+
indicate that the node number could not be determined (e.g
264+
for an address range that is reserved for future hot add of
265+
memory).
266+
267+
local_region_id: ID associated with access by agents
268+
local to this range of addresses.
269+
270+
remote_region_id: ID associated with access by agents
271+
non-local to this range of addresses.

Documentation/firmware-guide/acpi/dsd/data-node-references.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ ACPI in general allows referring to device objects in the tree only.
1212
Hierarchical data extension nodes may not be referred to directly, hence this
1313
document defines a scheme to implement such references.
1414

15-
A reference consist of the device object name followed by one or more
16-
hierarchical data extension [dsd-guide] keys. Specifically, the hierarchical
17-
data extension node which is referred to by the key shall lie directly under
18-
the parent object i.e. either the device object or another hierarchical data
19-
extension node.
15+
A reference to a _DSD hierarchical data node is a string consisting of a
16+
device object reference followed by a dot (".") and a relative path to a data
17+
node object. Do not use non-string references as this will produce a copy of
18+
the hierarchical data node, not a reference!
19+
20+
The hierarchical data extension node which is referred to shall be located
21+
directly under its parent object i.e. either the device object or another
22+
hierarchical data extension node [dsd-guide].
2023

2124
The keys in the hierarchical data nodes shall consist of the name of the node,
2225
"@" character and the number of the node in hexadecimal notation (without pre-
@@ -33,11 +36,9 @@ extension key.
3336
Example
3437
=======
3538

36-
In the ASL snippet below, the "reference" _DSD property contains a
37-
device object reference to DEV0 and under that device object, a
38-
hierarchical data extension key "node@1" referring to the NOD1 object
39-
and lastly, a hierarchical data extension key "anothernode" referring to
40-
the ANOD object which is also the final target node of the reference.
39+
In the ASL snippet below, the "reference" _DSD property contains a string
40+
reference to a hierarchical data extension node ANOD under DEV0 under the parent
41+
of DEV1. ANOD is also the final target node of the reference.
4142
::
4243

4344
Device (DEV0)
@@ -76,10 +77,7 @@ the ANOD object which is also the final target node of the reference.
7677
Name (_DSD, Package () {
7778
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
7879
Package () {
79-
Package () {
80-
"reference", Package () {
81-
^DEV0, "node@1", "anothernode"
82-
}
80+
Package () { "reference", "^DEV0.ANOD" }
8381
},
8482
}
8583
})

Documentation/firmware-guide/acpi/dsd/graph.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ of that port shall be zero. Similarly, if a port may only have a single
6666
endpoint, the number of that endpoint shall be zero.
6767

6868
The endpoint reference uses property extension with "remote-endpoint" property
69-
name followed by a reference in the same package. Such references consist of
70-
the remote device reference, the first package entry of the port data extension
71-
reference under the device and finally the first package entry of the endpoint
72-
data extension reference under the port. Individual references thus appear as::
69+
name followed by a string reference in the same package. [data-node-ref]::
7370

74-
Package() { device, "port@X", "endpoint@Y" }
71+
"device.datanode"
7572

7673
In the above example, "X" is the number of the port and "Y" is the number of
7774
the endpoint.
@@ -109,7 +106,7 @@ A simple example of this is show below::
109106
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
110107
Package () {
111108
Package () { "reg", 0 },
112-
Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } },
109+
Package () { "remote-endpoint", "\\_SB.PCI0.ISP.EP40" },
113110
}
114111
})
115112
}
@@ -141,7 +138,7 @@ A simple example of this is show below::
141138
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
142139
Package () {
143140
Package () { "reg", 0 },
144-
Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } },
141+
Package () { "remote-endpoint", "\\_SB.PCI0.I2C2.CAM0.EP00" },
145142
}
146143
})
147144
}

Documentation/firmware-guide/acpi/dsd/leds.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ Referring to LEDs in Device tree is documented in [video-interfaces], in
1515
"flash-leds" property documentation. In short, LEDs are directly referred to by
1616
using phandles.
1717

18-
While Device tree allows referring to any node in the tree [devicetree], in
19-
ACPI references are limited to device nodes only [acpi]. For this reason using
20-
the same mechanism on ACPI is not possible. A mechanism to refer to non-device
21-
ACPI nodes is documented in [data-node-ref].
22-
2318
ACPI allows (as does DT) using integer arguments after the reference. A
2419
combination of the LED driver device reference and an integer argument,
2520
referring to the "reg" property of the relevant LED, is used to identify
@@ -74,7 +69,7 @@ omitted. ::
7469
Package () {
7570
Package () {
7671
"flash-leds",
77-
Package () { ^LED, "led@0", ^LED, "led@1" },
72+
Package () { "^LED.LED0", "^LED.LED1" },
7873
}
7974
}
8075
})

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ config X86_64
3838
select ARCH_HAS_ELFCORE_COMPAT
3939
select ZONE_DMA32
4040
select EXECMEM if DYNAMIC_FTRACE
41+
select ACPI_MRRM if ACPI
4142

4243
config FORCE_DYNAMIC_FTRACE
4344
def_bool y

drivers/acpi/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ config ACPI_FFH
576576
Enable this feature if you want to set up and install the FFH Address
577577
Space handler to handle FFH OpRegion in the firmware.
578578

579+
config ACPI_MRRM
580+
bool
581+
579582
source "drivers/acpi/pmic/Kconfig"
580583

581584
config ACPI_VIOT

drivers/acpi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ acpi-$(CONFIG_ACPI_WATCHDOG) += acpi_watchdog.o
6666
acpi-$(CONFIG_ACPI_PRMT) += prmt.o
6767
acpi-$(CONFIG_ACPI_PCC) += acpi_pcc.o
6868
acpi-$(CONFIG_ACPI_FFH) += acpi_ffh.o
69+
acpi-$(CONFIG_ACPI_MRRM) += acpi_mrrm.o
6970

7071
# Address translation
7172
acpi-$(CONFIG_ACPI_ADXL) += acpi_adxl.o

drivers/acpi/acpi_mrrm.c

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (c) 2025, Intel Corporation.
4+
*
5+
* Memory Range and Region Mapping (MRRM) structure
6+
*
7+
* Parse and report the platform's MRRM table in /sys.
8+
*/
9+
10+
#define pr_fmt(fmt) "acpi/mrrm: " fmt
11+
12+
#include <linux/acpi.h>
13+
#include <linux/init.h>
14+
#include <linux/string.h>
15+
#include <linux/sysfs.h>
16+
17+
/* Default assume one memory region covering all system memory, per the spec */
18+
static int max_mem_region = 1;
19+
20+
/* Access for use by resctrl file system */
21+
int acpi_mrrm_max_mem_region(void)
22+
{
23+
return max_mem_region;
24+
}
25+
26+
struct mrrm_mem_range_entry {
27+
u64 base;
28+
u64 length;
29+
int node;
30+
u8 local_region_id;
31+
u8 remote_region_id;
32+
};
33+
34+
static struct mrrm_mem_range_entry *mrrm_mem_range_entry;
35+
static u32 mrrm_mem_entry_num;
36+
37+
static int get_node_num(struct mrrm_mem_range_entry *e)
38+
{
39+
unsigned int nid;
40+
41+
for_each_online_node(nid) {
42+
for (int z = 0; z < MAX_NR_ZONES; z++) {
43+
struct zone *zone = NODE_DATA(nid)->node_zones + z;
44+
45+
if (!populated_zone(zone))
46+
continue;
47+
if (zone_intersects(zone, PHYS_PFN(e->base), PHYS_PFN(e->length)))
48+
return zone_to_nid(zone);
49+
}
50+
}
51+
52+
return -ENOENT;
53+
}
54+
55+
static __init int acpi_parse_mrrm(struct acpi_table_header *table)
56+
{
57+
struct acpi_mrrm_mem_range_entry *mre_entry;
58+
struct acpi_table_mrrm *mrrm;
59+
void *mre, *mrrm_end;
60+
int mre_count = 0;
61+
62+
mrrm = (struct acpi_table_mrrm *)table;
63+
if (!mrrm)
64+
return -ENODEV;
65+
66+
if (mrrm->flags & ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS)
67+
return -EOPNOTSUPP;
68+
69+
mrrm_end = (void *)mrrm + mrrm->header.length - 1;
70+
mre = (void *)mrrm + sizeof(struct acpi_table_mrrm);
71+
while (mre < mrrm_end) {
72+
mre_entry = mre;
73+
mre_count++;
74+
mre += mre_entry->header.length;
75+
}
76+
if (!mre_count) {
77+
pr_info(FW_BUG "No ranges listed in MRRM table\n");
78+
return -EINVAL;
79+
}
80+
81+
mrrm_mem_range_entry = kmalloc_array(mre_count, sizeof(*mrrm_mem_range_entry),
82+
GFP_KERNEL | __GFP_ZERO);
83+
if (!mrrm_mem_range_entry)
84+
return -ENOMEM;
85+
86+
mre = (void *)mrrm + sizeof(struct acpi_table_mrrm);
87+
while (mre < mrrm_end) {
88+
struct mrrm_mem_range_entry *e;
89+
90+
mre_entry = mre;
91+
e = mrrm_mem_range_entry + mrrm_mem_entry_num;
92+
93+
e->base = mre_entry->addr_base;
94+
e->length = mre_entry->addr_len;
95+
e->node = get_node_num(e);
96+
97+
if (mre_entry->region_id_flags & ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL)
98+
e->local_region_id = mre_entry->local_region_id;
99+
else
100+
e->local_region_id = -1;
101+
if (mre_entry->region_id_flags & ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE)
102+
e->remote_region_id = mre_entry->remote_region_id;
103+
else
104+
e->remote_region_id = -1;
105+
106+
mrrm_mem_entry_num++;
107+
mre += mre_entry->header.length;
108+
}
109+
110+
max_mem_region = mrrm->max_mem_region;
111+
112+
return 0;
113+
}
114+
115+
#define RANGE_ATTR(name, fmt) \
116+
static ssize_t name##_show(struct kobject *kobj, \
117+
struct kobj_attribute *attr, char *buf) \
118+
{ \
119+
struct mrrm_mem_range_entry *mre; \
120+
const char *kname = kobject_name(kobj); \
121+
int n, ret; \
122+
\
123+
ret = kstrtoint(kname + 5, 10, &n); \
124+
if (ret) \
125+
return ret; \
126+
\
127+
mre = mrrm_mem_range_entry + n; \
128+
\
129+
return sysfs_emit(buf, fmt, mre->name); \
130+
} \
131+
static struct kobj_attribute name##_attr = __ATTR_RO(name)
132+
133+
RANGE_ATTR(base, "0x%llx\n");
134+
RANGE_ATTR(length, "0x%llx\n");
135+
RANGE_ATTR(node, "%d\n");
136+
RANGE_ATTR(local_region_id, "%d\n");
137+
RANGE_ATTR(remote_region_id, "%d\n");
138+
139+
static struct attribute *memory_range_attrs[] = {
140+
&base_attr.attr,
141+
&length_attr.attr,
142+
&node_attr.attr,
143+
&local_region_id_attr.attr,
144+
&remote_region_id_attr.attr,
145+
NULL
146+
};
147+
148+
ATTRIBUTE_GROUPS(memory_range);
149+
150+
static __init int add_boot_memory_ranges(void)
151+
{
152+
struct kobject *pkobj, *kobj;
153+
int ret = -EINVAL;
154+
char *name;
155+
156+
pkobj = kobject_create_and_add("memory_ranges", acpi_kobj);
157+
158+
for (int i = 0; i < mrrm_mem_entry_num; i++) {
159+
name = kasprintf(GFP_KERNEL, "range%d", i);
160+
if (!name)
161+
break;
162+
163+
kobj = kobject_create_and_add(name, pkobj);
164+
165+
ret = sysfs_create_groups(kobj, memory_range_groups);
166+
if (ret)
167+
return ret;
168+
}
169+
170+
return ret;
171+
}
172+
173+
static __init int mrrm_init(void)
174+
{
175+
int ret;
176+
177+
ret = acpi_table_parse(ACPI_SIG_MRRM, acpi_parse_mrrm);
178+
if (ret < 0)
179+
return ret;
180+
181+
return add_boot_memory_ranges();
182+
}
183+
device_initcall(mrrm_init);

drivers/acpi/acpi_pcc.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
struct pcc_data {
3333
struct pcc_mbox_chan *pcc_chan;
34-
void __iomem *pcc_comm_addr;
3534
struct completion done;
3635
struct mbox_client cl;
3736
struct acpi_pcc_info ctx;
@@ -81,14 +80,6 @@ acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function,
8180
ret = AE_SUPPORT;
8281
goto err_free_channel;
8382
}
84-
data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr,
85-
pcc_chan->shmem_size);
86-
if (!data->pcc_comm_addr) {
87-
pr_err("Failed to ioremap PCC comm region mem for %d\n",
88-
ctx->subspace_id);
89-
ret = AE_NO_MEMORY;
90-
goto err_free_channel;
91-
}
9283

9384
*region_context = data;
9485
return AE_OK;
@@ -113,7 +104,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
113104
reinit_completion(&data->done);
114105

115106
/* Write to Shared Memory */
116-
memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length);
107+
memcpy_toio(data->pcc_chan->shmem, (void *)value, data->ctx.length);
117108

118109
ret = mbox_send_message(data->pcc_chan->mchan, NULL);
119110
if (ret < 0)
@@ -134,7 +125,7 @@ acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr,
134125

135126
mbox_chan_txdone(data->pcc_chan->mchan, ret);
136127

137-
memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length);
128+
memcpy_fromio(value, data->pcc_chan->shmem, data->ctx.length);
138129

139130
return AE_OK;
140131
}

drivers/acpi/acpica/acapps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Module Name: acapps - common include for ACPI applications/tools
55
*
6-
* Copyright (C) 2000 - 2023, Intel Corp.
6+
* Copyright (C) 2000 - 2025, Intel Corp.
77
*
88
*****************************************************************************/
99

@@ -17,7 +17,7 @@
1717
/* Common info for tool signons */
1818

1919
#define ACPICA_NAME "Intel ACPI Component Architecture"
20-
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2022 Intel Corporation"
20+
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2025 Intel Corporation"
2121

2222
#if ACPI_MACHINE_WIDTH == 64
2323
#define ACPI_WIDTH " (64-bit version)"

0 commit comments

Comments
 (0)