2023-07-10 17:39:00

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 00/14] ACPICA 20230628

Hi All,

This series of patches is a set of ACPICA 20230628 changes described at
https://acpica.org/sites/acpica/files/changes_63.txt ported to Linux.

It contains the following material:

Abhishek Mainkar (1):
ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer

Bob Moore (1):
ACPICA: Update version to 20230628

Christophe Jaillet (1):
ACPICA: Slightly simplify an error message in acpi_ds_result_push()

Dave Jiang (2):
ACPICA: Fix misspelled CDAT DSMAS define
ACPICA: Add a define for size of struct acpi_srat_generic_affinity device_handle

George Guo (1):
ACPICA: Modify ACPI_STATE_COMMON

Jiangshan Yi (1):
ACPICA: exserial.c: replace ternary operator with ACPI_MIN()

Jose Marinho (2):
ACPICA: Detect GED device and keep track of _EVT
ACPICA: Add interrupt command to acpiexec

Najumon B.A (1):
ACPICA: fix for conflict macro definition on zephyr interface

Philip Prindeville (1):
ACPICA: Fix GCC 12 dangling-pointer warning

Saket Dumbre (1):
ACPICA: Add support for _DSC as per ACPI 6.5

Sunil V L (2):
ACPICA: MADT: Add RISC-V external interrupt controllers
ACPICA: RHCT: Add flags, CMO and MMU nodes

Thanks!





2023-07-10 17:44:26

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 09/14] ACPICA: Slightly simplify an error message in acpi_ds_result_push()

From: Christophe JAILLET <[email protected]>

ACPICA commit 3a9dbc5cb1573b87a16b50918977ab9e53e24408

'object' is known to be NULL at this point. There is little value to log
it twice in the error message.

Link: https://github.com/acpica/acpica/commit/3a9dbc5c
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/dswstate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c
index d3841ded3a81..75338a13c802 100644
--- a/drivers/acpi/acpica/dswstate.c
+++ b/drivers/acpi/acpica/dswstate.c
@@ -146,8 +146,8 @@ acpi_ds_result_push(union acpi_operand_object *object,

if (!object) {
ACPI_ERROR((AE_INFO,
- "Null Object! Obj=%p State=%p Num=%u",
- object, walk_state, walk_state->result_count));
+ "Null Object! State=%p Num=%u",
+ walk_state, walk_state->result_count));
return (AE_BAD_PARAMETER);
}

--
2.35.3





2023-07-10 17:59:24

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 11/14] ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer

From: Abhishek Mainkar <[email protected]>

ACPICA commit 90310989a0790032f5a0140741ff09b545af4bc5

According to the ACPI specification 19.6.134, no argument is required to be passed for ASL Timer instruction. For taking care of no argument, AML_NO_OPERAND_RESOLVE flag is added to ASL Timer instruction opcode.

When ASL timer instruction interpreted by ACPI interpreter, getting error. After adding AML_NO_OPERAND_RESOLVE flag to ASL Timer instruction opcode, issue is not observed.

=============================================================
UBSAN: array-index-out-of-bounds in acpica/dswexec.c:401:12 index -1 is out of range for type 'union acpi_operand_object *[9]'
CPU: 37 PID: 1678 Comm: cat Not tainted
6.0.0-dev-th500-6.0.y-1+bcf8c46459e407-generic-64k
HW name: NVIDIA BIOS v1.1.1-d7acbfc-dirty 12/19/2022 Call trace:
dump_backtrace+0xe0/0x130
show_stack+0x20/0x60
dump_stack_lvl+0x68/0x84
dump_stack+0x18/0x34
ubsan_epilogue+0x10/0x50
__ubsan_handle_out_of_bounds+0x80/0x90
acpi_ds_exec_end_op+0x1bc/0x6d8
acpi_ps_parse_loop+0x57c/0x618
acpi_ps_parse_aml+0x1e0/0x4b4
acpi_ps_execute_method+0x24c/0x2b8
acpi_ns_evaluate+0x3a8/0x4bc
acpi_evaluate_object+0x15c/0x37c
acpi_evaluate_integer+0x54/0x15c
show_power+0x8c/0x12c [acpi_power_meter]

Link: https://github.com/acpica/acpica/commit/90310989
Signed-off-by: Abhishek Mainkar <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/psopcode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index 09029fe545f1..39e31030e5f4 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -603,7 +603,7 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {

/* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY,
AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R,
- AML_FLAGS_EXEC_0A_0T_1R),
+ AML_FLAGS_EXEC_0A_0T_1R | AML_NO_OPERAND_RESOLVE),

/* ACPI 5.0 opcodes */

--
2.35.3





2023-07-10 18:02:29

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 08/14] ACPICA: Fix misspelled CDAT DSMAS define

From: Dave Jiang <[email protected]>

ACPICA commit 32a50922b66a9e288b9a9b4740de86a542668a43

ACPI_CEDT_DSMAS_NON_VOLATILE -> ACPI_CDAT_DSMAS_NON_VOLATILE

Link: https://github.com/acpica/acpica/commit/32a50922
Signed-off-by: Dave Jiang <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
include/acpi/actbl1.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 58b0490a2ad1..8d5572ad48cb 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -402,7 +402,7 @@ struct acpi_cdat_dsmas {

/* Flags for subtable above */

-#define ACPI_CEDT_DSMAS_NON_VOLATILE (1 << 2)
+#define ACPI_CDAT_DSMAS_NON_VOLATILE (1 << 2)

/* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */

--
2.35.3





2023-07-10 18:03:50

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 02/14] ACPICA: Modify ACPI_STATE_COMMON

From: George Guo <[email protected]>

ACPICA commit 0a43d3521582b5234f69e8bb535e83325387525a

Avoid trailing semicolons in macro, and it's not readable to put macro ACPI_STATE_COMMON and other
variables in the same line.
So modify the macro and just put it in a single line.

Link: https://github.com/acpica/acpica/commit/0a43d352
Signed-off-by: George Guo <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/aclocal.h | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 12d4a024f029..75a81b6c1a16 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -560,25 +560,28 @@ struct acpi_field_info {
u8 descriptor_type; /* To differentiate various internal objs */\
u8 flags; \
u16 value; \
- u16 state;
+ u16 state

/* There are 2 bytes available here until the next natural alignment boundary */

struct acpi_common_state {
-ACPI_STATE_COMMON};
+ ACPI_STATE_COMMON;
+};

/*
* Update state - used to traverse complex objects such as packages
*/
struct acpi_update_state {
- ACPI_STATE_COMMON union acpi_operand_object *object;
+ ACPI_STATE_COMMON;
+ union acpi_operand_object *object;
};

/*
* Pkg state - used to traverse nested package structures
*/
struct acpi_pkg_state {
- ACPI_STATE_COMMON u32 index;
+ ACPI_STATE_COMMON;
+ u32 index;
union acpi_operand_object *source_object;
union acpi_operand_object *dest_object;
struct acpi_walk_state *walk_state;
@@ -591,7 +594,8 @@ struct acpi_pkg_state {
* Allows nesting of these constructs
*/
struct acpi_control_state {
- ACPI_STATE_COMMON u16 opcode;
+ ACPI_STATE_COMMON;
+ u16 opcode;
union acpi_parse_object *predicate_op;
u8 *aml_predicate_start; /* Start of if/while predicate */
u8 *package_end; /* End of if/while block */
@@ -602,11 +606,13 @@ struct acpi_control_state {
* Scope state - current scope during namespace lookups
*/
struct acpi_scope_state {
- ACPI_STATE_COMMON struct acpi_namespace_node *node;
+ ACPI_STATE_COMMON;
+ struct acpi_namespace_node *node;
};

struct acpi_pscope_state {
- ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
+ ACPI_STATE_COMMON;
+ u32 arg_count; /* Number of fixed arguments */
union acpi_parse_object *op; /* Current op being parsed */
u8 *arg_end; /* Current argument end */
u8 *pkg_end; /* Current package end */
@@ -618,7 +624,8 @@ struct acpi_pscope_state {
* states are created when there are nested control methods executing.
*/
struct acpi_thread_state {
- ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
+ ACPI_STATE_COMMON;
+ u8 current_sync_level; /* Mutex Sync (nested acquire) level */
struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
acpi_thread_id thread_id; /* Running thread ID */
@@ -629,8 +636,8 @@ struct acpi_thread_state {
* AML arguments
*/
struct acpi_result_values {
- ACPI_STATE_COMMON
- union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
+ ACPI_STATE_COMMON;
+ union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
};

typedef
@@ -652,7 +659,8 @@ struct acpi_global_notify_handler {
* handler/dispatcher.
*/
struct acpi_notify_info {
- ACPI_STATE_COMMON u8 handler_list_id;
+ ACPI_STATE_COMMON;
+ u8 handler_list_id;
struct acpi_namespace_node *node;
union acpi_operand_object *handler_list_head;
struct acpi_global_notify_handler *global;
--
2.35.3





2023-07-10 18:04:27

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 01/14] ACPICA: Fix GCC 12 dangling-pointer warning

From: Philip Prindeville <[email protected]>

ACPICA commit aea0a5cfce262ce2ab16fd96d87c12cf5e756380

We're storing a persistent pointer to an ephemeral local variable
which technically is a dangling pointer and the compiler is correct.
However, since we never indirect the pointer, this is a safe
operation and we can suppress the warning.

Also, some C run-times (like MUSL) aren't including <stdint.h>
indirectly so we must include it explicitly or we won't have the
type definition for uintptr_t.

Link: https://github.com/acpica/acpica/commit/aea0a5cf
Signed-off-by: Philip Prindeville <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/utdebug.c | 5 +++++
include/acpi/platform/aclinux.h | 1 +
2 files changed, 6 insertions(+)

diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 1bbba8585fa6..c5f6c85a3a09 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -37,7 +37,12 @@ void acpi_ut_init_stack_ptr_trace(void)
{
acpi_size current_sp;

+#pragma GCC diagnostic push
+#if defined(__GNUC__) && __GNUC__ >= 12
+#pragma GCC diagnostic ignored "-Wdangling-pointer="
+#endif
acpi_gbl_entry_stack_pointer = &current_sp;
+#pragma GCC diagnostic pop
}

/*******************************************************************************
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 1ca450e35c0d..565341c826e3 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -182,6 +182,7 @@
#ifdef ACPI_USE_STANDARD_HEADERS
#include <stddef.h>
#include <unistd.h>
+#include <stdint.h>

#define ACPI_OFFSET(d, f) offsetof(d, f)
#endif
--
2.35.3





2023-07-10 18:22:54

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 05/14] ACPICA: fix for conflict macro definition on zephyr interface

From: "Najumon B.A" <[email protected]>

ACPICA commit c71a12dfc66593fa9730c62a519161c4a7fca9f6

remove SEEK_SET/SEEK_END duplicate macro on zephyr header which through
error while run zephyr CI jobs.

Link: https://github.com/acpica/acpica/commit/c71a12df
Signed-off-by: Najumon B.A <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
include/acpi/platform/aczephyr.h | 3 ---
1 file changed, 3 deletions(-)

diff --git a/include/acpi/platform/aczephyr.h b/include/acpi/platform/aczephyr.h
index 2f0d30c3c5fd..703db4dc740d 100644
--- a/include/acpi/platform/aczephyr.h
+++ b/include/acpi/platform/aczephyr.h
@@ -10,9 +10,6 @@
#ifndef __ACZEPHYR_H__
#define __ACZEPHYR_H__

-#define SEEK_SET FS_SEEK_SET
-#define SEEK_END FS_SEEK_END
-
#define ACPI_MACHINE_WIDTH 64

#define ACPI_NO_ERROR_MESSAGES
--
2.35.3





2023-07-10 18:36:39

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 03/14] ACPICA: exserial.c: replace ternary operator with ACPI_MIN()

From: Jiangshan Yi <[email protected]>

ACPICA commit 2250f71fe77396db21df805222ffcbf19e1e7896

Make the code simpler and more readable.

Link: https://github.com/acpica/acpica/commit/2250f71f
Signed-off-by: Jiangshan Yi <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/exserial.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exserial.c
index 5d99b1a76c83..5241f4c01c76 100644
--- a/drivers/acpi/acpica/exserial.c
+++ b/drivers/acpi/acpica/exserial.c
@@ -343,8 +343,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
/* Copy the input buffer data to the transfer buffer */

buffer = buffer_desc->buffer.pointer;
- data_length = (buffer_length < source_desc->buffer.length ?
- buffer_length : source_desc->buffer.length);
+ data_length = ACPI_MIN(buffer_length, source_desc->buffer.length);
memcpy(buffer, source_desc->buffer.pointer, data_length);

/* Lock entire transaction if requested */
--
2.35.3





2023-07-10 18:37:54

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 14/14] ACPICA: Update version to 20230628

From: Bob Moore <[email protected]>

ACPICA commit f16a0b4d0f0edd7b78a332fcf507be2187fac21e

Version 20230628.

Link: https://github.com/acpica/acpica/commit/f16a0b4d
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
include/acpi/acpixf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 9ffdc0425bc2..0c1b69ad95d0 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -12,7 +12,7 @@

/* Current ACPICA subsystem version in YYYYMMDD format */

-#define ACPI_CA_VERSION 0x20230331
+#define ACPI_CA_VERSION 0x20230628

#include <acpi/acconfig.h>
#include <acpi/actypes.h>
--
2.35.3





2023-07-10 18:37:56

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 06/14] ACPICA: Detect GED device and keep track of _EVT

From: Jose Marinho <[email protected]>

ACPICA commit dc6fd1d12903015726a8a6f87f63e86141576a68

The GED device is described by a _HID of ACPI0013.
This code traverses the namespace identifying all GED devices.
For each GED device in the namespace we record 1) the Interrupt objects
and the _EVT method.

This information is used when an interrupt is simulate.

Link: https://github.com/acpica/acpica/commit/dc6fd1d1
Signed-off-by: Jose Marinho <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
drivers/acpi/acpica/acglobal.h | 1 +
drivers/acpi/acpica/aclocal.h | 8 ++++++++
include/acpi/acnames.h | 1 +
3 files changed, 10 insertions(+)

diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 778241173ed4..f4c90fc99be2 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -129,6 +129,7 @@ ACPI_GLOBAL(acpi_table_handler, acpi_gbl_table_handler);
ACPI_GLOBAL(void *, acpi_gbl_table_handler_context);
ACPI_GLOBAL(acpi_interface_handler, acpi_gbl_interface_handler);
ACPI_GLOBAL(struct acpi_sci_handler_info *, acpi_gbl_sci_handler_list);
+ACPI_GLOBAL(struct acpi_ged_handler_info *, acpi_gbl_ged_handler_list);

/* Owner ID support */

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 75a81b6c1a16..82563b44af35 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -543,6 +543,14 @@ struct acpi_field_info {
u32 pkg_length;
};

+/* Information about the interrupt ID and _EVT of a GED device */
+
+struct acpi_ged_handler_info {
+ struct acpi_ged_handler_info *next;
+ u32 int_id; /* The interrupt ID that triggers the execution ofthe evt_method. */
+ struct acpi_namespace_node *evt_method; /* The _EVT method to be executed when an interrupt with ID = int_ID is received */
+};
+
/*****************************************************************************
*
* Generic "state" object for stacks
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index d71291f25a80..76aa6aa346ba 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -22,6 +22,7 @@
#define METHOD_NAME__DDN "_DDN"
#define METHOD_NAME__DIS "_DIS"
#define METHOD_NAME__DMA "_DMA"
+#define METHOD_NAME__EVT "_EVT"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
--
2.35.3





2023-07-10 18:41:07

by Rafael J. Wysocki

[permalink] [raw]
Subject: [PATCH 10/14] ACPICA: Add a define for size of struct acpi_srat_generic_affinity device_handle

From: Dave Jiang <[email protected]>

ACPICA commit be56820b03d8aeabfa6709c4d99bf1711afe7ef1

Replace magic number with a define. Linux kernel code will utilize this
define.

Link: https://github.com/acpica/acpica/commit/be56820b
Signed-off-by: Dave Jiang <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
include/acpi/actbl3.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index 000764ab3985..c080d579a546 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -279,12 +279,14 @@ struct acpi_srat_gic_its_affinity {
* 6: ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY
*/

+#define ACPI_SRAT_DEVICE_HANDLE_SIZE 16
+
struct acpi_srat_generic_affinity {
struct acpi_subtable_header header;
u8 reserved;
u8 device_handle_type;
u32 proximity_domain;
- u8 device_handle[16];
+ u8 device_handle[ACPI_SRAT_DEVICE_HANDLE_SIZE];
u32 flags;
u32 reserved1;
};
--
2.35.3