Skip to contentSkip to conversation

ACPICA release 20170929

PATCH In review Erik Schmauss 3 participants 17 messages Nov 17, 2017 – Dec 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ACPICA release 20170929

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

 drivers/acpi/acpica/acapps.h             |  3 ++
 drivers/acpi/acpica/aclocal.h            |  2 +-
 drivers/acpi/acpica/dscontrol.c          | 18 ++++----
 drivers/acpi/acpica/hwtimer.c            | 29 ++++++------
 drivers/acpi/acpica/nsaccess.c           | 13 +++---
 drivers/acpi/acpica/nssearch.c           |  1 +
 drivers/acpi/acpica/psobject.c           | 10 +----
 drivers/acpi/acpica/psutils.c            |  6 +--
 drivers/acpi/acpica/utinit.c             |  1 -
 drivers/acpi/acpica/utmath.c             |  4 +-
 include/acpi/acconfig.h                  |  4 +-
 include/acpi/acexcep.h                   |  6 +--
 include/acpi/acpixf.h                    |  6 +--
 include/acpi/actbl1.h                    | 77 +++++++++++++++++++++++++++++---
 include/acpi/actbl2.h                    | 14 +++++-
 include/acpi/actypes.h                   |  2 +
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++--
 17 files changed, 160 insertions(+), 64 deletions(-)
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/11 ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

From: Jung-uk Kim <jkim@free_BSD.org>

ACPICA commit b4fd33f3c2af014aeec978d46392d286fd7f52b3

Delta calculation has an off-by-one error when there is a rollover. For example, when start_ticks is 0x00FFFFFF and end_ticks is 0x00000000 (for 24-bit timer), delta_ticks should be 1 (one) but it was 0 (zero).

---
 drivers/acpi/acpica/hwtimer.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)
drivers/acpi/acpica/hwtimer.c +14 -15
index a2f4e25d45b1..5b4282902a83 100644
@@ -150,10 +150,10 @@ ACPI_EXPORT_SYMBOL(acpi_get_timer)
  *
  ******************************************************************************/
 acpi_status
-acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
+acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed)
 {
 	acpi_status status;
-	u32 delta_ticks;
+	u64 delta_ticks;
 	u64 quotient;
 
 	ACPI_FUNCTION_TRACE(acpi_get_timer_duration);
@@ -168,30 +168,29 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
 		return_ACPI_STATUS(AE_SUPPORT);
 	}
 
+	if (start_ticks == end_ticks) {
+		*time_elapsed = 0;
+		return_ACPI_STATUS(AE_OK);
+	}
+
 	/*
 	 * Compute Tick Delta:
 	 * Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
 	 */
-	if (start_ticks < end_ticks) {
-		delta_ticks = end_ticks - start_ticks;
-	} else if (start_ticks > end_ticks) {
+	delta_ticks = end_ticks;
+	if (start_ticks > end_ticks) {
 		if ((acpi_gbl_FADT.flags & ACPI_FADT_32BIT_TIMER) == 0) {
 
 			/* 24-bit Timer */
 
-			delta_ticks =
-			    (((0x00FFFFFF - start_ticks) +
-			      end_ticks) & 0x00FFFFFF);
+			delta_ticks |= (u64)1 << 24;
 		} else {
 			/* 32-bit Timer */
 
-			delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks;
+			delta_ticks |= (u64)1 << 32;
 		}
-	} else {		/* start_ticks == end_ticks */
-
-		*time_elapsed = 0;
-		return_ACPI_STATUS(AE_OK);
 	}
+	delta_ticks -= start_ticks;
 
 	/*
 	 * Compute Duration (Requires a 64-bit multiply and divide):
@@ -199,10 +198,10 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
 	 * time_elapsed (microseconds) =
 	 *  (delta_ticks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY;
 	 */
-	status = acpi_ut_short_divide(((u64)delta_ticks) * ACPI_USEC_PER_SEC,
+	status = acpi_ut_short_divide(delta_ticks * ACPI_USEC_PER_SEC,
 				      ACPI_PM_TIMER_FREQUENCY, &quotient, NULL);
 
-	*time_elapsed = (u32) quotient;
+	*time_elapsed = (u32)quotient;
 	return_ACPI_STATUS(status);
 }
 
Signature · 1 line
2.13.6
#2 lore raw

PATCH 2/11 ACPICA: Disassembler: reset parser_state's Aml pointer when parsing bad externals

In reply to Erik Schmauss

ACPICA commit e7e25137471d7f75960fdb8caf757db0426245ca

---
 drivers/acpi/acpica/psobject.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpica/psobject.c +1 -0
index 0bef6df71bba..8cbe36159376 100644
@@ -382,6 +382,7 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
 			     walk_state->aml -
 			     walk_state->parser_state.aml_start);
 			walk_state->aml = walk_state->parser_state.aml + 2;
+			walk_state->parser_state.aml = walk_state->aml;
 			return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
 		}
 #endif
Signature · 1 line
2.13.6
#3 lore raw

PATCH 3/11 ACPICA: disassembler: getting rid of error message

In reply to Erik Schmauss

ACPICA commit 7d542c6f97e27f7d0e90be1afd98097c3840e007

This error message tends to clutter up the disassembled ASL file with information that is unnecessary.

---
 drivers/acpi/acpica/psobject.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/acpi/acpica/psobject.c +1 -8
index 8cbe36159376..c0b179883ff2 100644
@@ -372,15 +372,8 @@ acpi_ps_create_op(struct acpi_walk_state *walk_state,
 			 * external declaration opcode. Setting walk_state->Aml to
 			 * walk_state->parser_state.Aml + 2 moves increments the
 			 * walk_state->Aml past the object type and the paramcount of the
-			 * external opcode. For the error message, only print the AML
-			 * offset. We could attempt to print the name but this may cause
-			 * a segmentation fault when printing the namepath because the
-			 * AML may be incorrect.
+			 * external opcode.
 			 */
-			acpi_os_printf
-			    ("// Invalid external declaration at AML offset 0x%x.\n",
-			     walk_state->aml -
-			     walk_state->parser_state.aml_start);
 			walk_state->aml = walk_state->parser_state.aml + 2;
 			walk_state->parser_state.aml = walk_state->aml;
 			return_ACPI_STATUS(AE_CTRL_PARSE_CONTINUE);
Signature · 1 line
2.13.6
#4 lore raw

PATCH 4/11 ACPICA: Avoid null pointer dereference on Op.

In reply to Erik Schmauss

From: Colin Ian King <[email protected]>

ACPICA commit 08a00639b0d6756e8ba1421419fc3728904651d9

The calls to acpi_os_acquire_object can result in a null being assigned to Op (for example if a mutex acquire fails) which can lead to a null pointer dereference on Op on the call to ASL_CV_TRANSFER_COMMENTS (via function cv_transfer_comments). Move the block into the previous block that checks for a null Op so that we never can call cv_transfer_comments with a null Op.

Detected by: coverity_scan CID#1371660 ("Dereference after null check")

---
 drivers/acpi/acpica/psutils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/acpica/psutils.c +3 -3
index 02642760cb93..e15b636b1d4b 100644
@@ -158,10 +158,10 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml)
 		if (opcode == AML_SCOPE_OP) {
 			acpi_gbl_current_scope = op;
 		}
-	}
 
-	if (gbl_capture_comments) {
-		ASL_CV_TRANSFER_COMMENTS(op);
+		if (gbl_capture_comments) {
+			ASL_CV_TRANSFER_COMMENTS(op);
+		}
 	}
 
 	return (op);
Signature · 1 line
2.13.6
#5 lore raw

PATCH 5/11 ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop detection

In reply to Erik Schmauss

From: Lv Zheng <[email protected]>

ACPICA commit 9605023e7e6d1f05581502766c8cf2905bcc03d9

This patch implements a new infinite loop detection mechanism to replace the old one, it uses acpi_os_get_timer() to limit loop execution into a determined time slice.
This is useful in case some hardware/firmware operations really require the AML interpreter to wait while the old mechanism could expire too fast on recent machines.

The new mechanism converts old acpi_gbl_max_loop_iterations to store the user configurable value for the new mechanism in order to allow users to be still able to configure this value for acpiexec via command line. This patch also removes wrong initilization code of acpi_gbl_max_loop_iterations accordingly (it should have been initialized by ACPI_INIT_GLOBAL, and the default value is also properly tuned for acpiexec). Reported by M. Foronda, fixed by Lv Zheng.

---
 drivers/acpi/acpica/aclocal.h   |  2 +-
 drivers/acpi/acpica/dscontrol.c | 16 +++++++++-------
 drivers/acpi/acpica/utinit.c    |  1 -
 include/acpi/acconfig.h         |  4 ++--
 include/acpi/acpixf.h           |  4 ++--
 include/acpi/actypes.h          |  2 ++
 6 files changed, 16 insertions(+), 13 deletions(-)
drivers/acpi/acpica/aclocal.h +1 -1
index 0d45b8bb1678..bed041d41596 100644
@@ -622,7 +622,7 @@ struct acpi_control_state {
 	union acpi_parse_object *predicate_op;
 	u8 *aml_predicate_start;	/* Start of if/while predicate */
 	u8 *package_end;	/* End of if/while block */
-	u32 loop_count;		/* While() loop counter */
+	u64 loop_timeout;	/* While() loop timeout */
 };
 
 /*
drivers/acpi/acpica/dscontrol.c +9 -7
index f470e81b0499..244075dbc03a 100644
@@ -118,6 +118,8 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
 		control_state->control.package_end =
 		    walk_state->parser_state.pkg_end;
 		control_state->control.opcode = op->common.aml_opcode;
+		control_state->control.loop_timeout = acpi_os_get_timer() +
+		    (u64)(acpi_gbl_max_loop_iterations * ACPI_100NSEC_PER_SEC);
 
 		/* Push the control state on this walk's control stack */
 
@@ -206,14 +208,14 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state,
 			/* Predicate was true, the body of the loop was just executed */
 
 			/*
-			 * This loop counter mechanism allows the interpreter to escape
-			 * possibly infinite loops. This can occur in poorly written AML
-			 * when the hardware does not respond within a while loop and the
-			 * loop does not implement a timeout.
+			 * This infinite loop detection mechanism allows the interpreter
+			 * to escape possibly infinite loops. This can occur in poorly
+			 * written AML when the hardware does not respond within a while
+			 * loop and the loop does not implement a timeout.
 			 */
-			control_state->control.loop_count++;
-			if (control_state->control.loop_count >
-			    acpi_gbl_max_loop_iterations) {
+			if (ACPI_TIME_AFTER(acpi_os_get_timer(),
+					    control_state->control.
+					    loop_timeout)) {
 				status = AE_AML_INFINITE_LOOP;
 				break;
 			}
drivers/acpi/acpica/utinit.c +0 -1
index 23e766d1691d..45eeb0dcf283 100644
@@ -206,7 +206,6 @@ acpi_status acpi_ut_init_globals(void)
 	acpi_gbl_next_owner_id_offset = 0;
 	acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
 	acpi_gbl_osi_mutex = NULL;
-	acpi_gbl_max_loop_iterations = ACPI_MAX_LOOP_COUNT;
 
 	/* Hardware oriented */
 
include/acpi/acconfig.h +2 -2
index 6db3b4668b1a..ffe364fa4040 100644
@@ -145,9 +145,9 @@
 
 #define ACPI_ADDRESS_RANGE_MAX          2
 
-/* Maximum number of While() loops before abort */
+/* Maximum time (default 30s) of While() loops before abort */
 
-#define ACPI_MAX_LOOP_COUNT             0x000FFFFF
+#define ACPI_MAX_LOOP_TIMEOUT           30
 
 /******************************************************************************
  *
include/acpi/acpixf.h +2 -2
index e1dd1a8d42b6..1a4322db0274 100644
@@ -260,11 +260,11 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
 
 /*
- * Maximum number of While() loop iterations before forced method abort.
+ * Maximum timeout for While() loop iterations before forced method abort.
  * This mechanism is intended to prevent infinite loops during interpreter
  * execution within a host kernel.
  */
-ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_COUNT);
+ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_TIMEOUT);
 
 /*
  * This mechanism is used to trace a specified AML method. The method is
include/acpi/actypes.h +2 -0
index 4f077edb9b81..ddde2790a54a 100644
@@ -468,6 +468,8 @@ typedef void *acpi_handle;	/* Actually a ptr to a NS Node */
 #define ACPI_NSEC_PER_MSEC              1000000L
 #define ACPI_NSEC_PER_SEC               1000000000L
 
+#define ACPI_TIME_AFTER(a, b)           ((s64)((b) - (a)) < 0)
+
 /* Owner IDs are used to track namespace nodes for selective deletion */
 
 typedef u8 acpi_owner_id;
Signature · 1 line
2.13.6
#6 lore raw

PATCH 6/11 ACPICA: Rename AE_AML_INFINITE_LOOP exception

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit e017213698374e01225f641ba0917516d8e91427

More appropriately renamed to AE_AML_LOOP_TIMEOUT, now that a real timer is used for the implementation.

---
 drivers/acpi/acpica/dscontrol.c | 2 +-
 include/acpi/acexcep.h          | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/acpi/acpica/dscontrol.c +1 -1
index 244075dbc03a..4b6ebc2a2851 100644
@@ -216,7 +216,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state,
 			if (ACPI_TIME_AFTER(acpi_os_get_timer(),
 					    control_state->control.
 					    loop_timeout)) {
-				status = AE_AML_INFINITE_LOOP;
+				status = AE_AML_LOOP_TIMEOUT;
 				break;
 			}
 
include/acpi/acexcep.h +3 -3
index 17d61b1f2511..e1f9fe47f69e 100644
@@ -195,7 +195,7 @@ struct acpi_exception_info {
 #define AE_AML_CIRCULAR_REFERENCE       EXCEP_AML (0x001E)
 #define AE_AML_BAD_RESOURCE_LENGTH      EXCEP_AML (0x001F)
 #define AE_AML_ILLEGAL_ADDRESS          EXCEP_AML (0x0020)
-#define AE_AML_INFINITE_LOOP            EXCEP_AML (0x0021)
+#define AE_AML_LOOP_TIMEOUT             EXCEP_AML (0x0021)
 #define AE_AML_UNINITIALIZED_NODE       EXCEP_AML (0x0022)
 #define AE_AML_TARGET_TYPE              EXCEP_AML (0x0023)
 
@@ -368,8 +368,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = {
 		  "The length of a Resource Descriptor in the AML is incorrect"),
 	EXCEP_TXT("AE_AML_ILLEGAL_ADDRESS",
 		  "A memory, I/O, or PCI configuration address is invalid"),
-	EXCEP_TXT("AE_AML_INFINITE_LOOP",
-		  "An apparent infinite AML While loop, method was aborted"),
+	EXCEP_TXT("AE_AML_LOOP_TIMEOUT",
+		  "An AML While loop exceeded the maximum execution time"),
 	EXCEP_TXT("AE_AML_UNINITIALIZED_NODE",
 		  "A namespace node is uninitialized or unresolved"),
 	EXCEP_TXT("AE_AML_TARGET_TYPE",
Signature · 1 line
2.13.6
#7 lore raw

PATCH 7/11 ACPICA: Tools: Deploy -vd option (build date/time) across all tools

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit 336131640a1574b86240b32eca3150195f9270d6

Common option for all tools.

---
 drivers/acpi/acpica/acapps.h             |  3 +++
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++++++++++++++++----
 2 files changed, 27 insertions(+), 4 deletions(-)
drivers/acpi/acpica/acapps.h +3 -0
index 7a1a68b5ac5c..2243c8164b34 100644
@@ -80,6 +80,9 @@
 	prefix, ACPICA_COPYRIGHT, \
 	prefix
 
+#define ACPI_COMMON_BUILD_TIME \
+	"Build date/time: %s %s\n", __DATE__, __TIME__
+
 /* Macros for usage messages */
 
 #define ACPI_USAGE_HEADER(usage) \
tools/power/acpi/tools/acpidump/apmain.c +24 -4
index 22c3b4ee1617..be418fba9441 100644
@@ -79,7 +79,7 @@ struct ap_dump_action action_table[AP_MAX_ACTIONS];
 u32 current_action = 0;
 
 #define AP_UTILITY_NAME             "ACPI Binary Table Dump Utility"
-#define AP_SUPPORTED_OPTIONS        "?a:bc:f:hn:o:r:svxz"
+#define AP_SUPPORTED_OPTIONS        "?a:bc:f:hn:o:r:sv^xz"
 
 /******************************************************************************
  *
@@ -100,6 +100,7 @@ static void ap_display_usage(void)
 	ACPI_OPTION("-r <Address>", "Dump tables from specified RSDP");
 	ACPI_OPTION("-s", "Print table summaries only");
 	ACPI_OPTION("-v", "Display version information");
+	ACPI_OPTION("-vd", "Display build date and time");
 	ACPI_OPTION("-z", "Verbose mode");
 
 	ACPI_USAGE_TEXT("\nTable Options:\n");
@@ -231,10 +232,29 @@ static int ap_do_options(int argc, char **argv)
 			}
 			continue;
 
-		case 'v':	/* Revision/version */
+		case 'v':	/* -v: (Version): signon already emitted, just exit */
 
-			acpi_os_printf(ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
-			return (1);
+			switch (acpi_gbl_optarg[0]) {
+			case '^':	/* -v: (Version) */
+
+				fprintf(stderr,
+					ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
+				return (1);
+
+			case 'd':
+
+				fprintf(stderr,
+					ACPI_COMMON_SIGNON(AP_UTILITY_NAME));
+				printf(ACPI_COMMON_BUILD_TIME);
+				return (1);
+
+			default:
+
+				printf("Unknown option: -v%s\n",
+				       acpi_gbl_optarg);
+				return (-1);
+			}
+			break;
 
 		case 'z':	/* Verbose mode */
 
Signature · 1 line
2.13.6
#8 lore raw

PATCH 8/11 ACPICA: iASL: change processing of external op namespace nodes for correctness

In reply to Erik Schmauss

ACPICA commit aa866a9b4f24bbec9f158d10325b486d7d12d90f

The declaration External (ABCD.EFGH) creates two nodes in the namespace: ABCD and EFGH where ABCD is marked as an implicit external node. ABCD is labeled as implicit because there does not exist a specific External (ABCD) declaration.

Before this change, the declaration External (ABCD.EFGH) and External (ABCD.EFGH.IJKL) creates the namespace nodes ABCD, EFGH, and IJKL where ABCD and EFGH are labeled as implicit external nodes. This is incorrect. The only implicit node should be ABCD because EFGH and IJKL are explicit nodes. This change fixes the labeling procecess of external op namespace nodes so that nodes are properly labeled as implicit external.

Due to this commit, the below ASL code results in a compilation error.

definition_block ("DSDT.aml", "DSDT", 0x02, "INTEL", "BDW ", 0x0)

{
    External(\_SB.PCI0.GFX0, device_obj)
    External(\_SB.PCI0.GFX0.ALSI)

    Scope(\_SB)
    {
        Device(PCI0)
        {
            Device(GFX0)
            {
                Name(_ADR, 0x00020000)
            }
        }
    }
}
---
 drivers/acpi/acpica/nsaccess.c | 13 +++++++------
 drivers/acpi/acpica/nssearch.c |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/acpi/acpica/nsaccess.c +7 -6
index f2733f51ca8d..33e652a12fca 100644
@@ -644,17 +644,18 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
 					    this_node->object;
 				}
 			}
-#ifdef ACPI_ASL_COMPILER
-			if (!acpi_gbl_disasm_flag &&
-			    (this_node->flags & ANOBJ_IS_EXTERNAL)) {
-				this_node->flags |= IMPLICIT_EXTERNAL;
-			}
-#endif
 		}
 
 		/* Special handling for the last segment (num_segments == 0) */
 
 		else {
+#ifdef ACPI_ASL_COMPILER
+			if (!acpi_gbl_disasm_flag
+			    && (this_node->flags & ANOBJ_IS_EXTERNAL)) {
+				this_node->flags &= ~IMPLICIT_EXTERNAL;
+			}
+#endif
+
 			/*
 			 * Sanity typecheck of the target object:
 			 *
drivers/acpi/acpica/nssearch.c +1 -0
index 5de8957f5ef0..e91dbee9235f 100644
@@ -417,6 +417,7 @@ acpi_ns_search_and_enter(u32 target_name,
 	if (flags & ACPI_NS_EXTERNAL ||
 	    (walk_state && walk_state->opcode == AML_SCOPE_OP)) {
 		new_node->flags |= ANOBJ_IS_EXTERNAL;
+		new_node->flags |= IMPLICIT_EXTERNAL;
 	}
 #endif
 
Signature · 1 line
2.13.6
#9 lore raw

PATCH 9/11 ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit 028d331522f239fa615148273f6d10e9deadb1b3

Full support for PDTT and SDEV
Partial support for TPM2 due to odd layout of the optional fields of the table.

---
 include/acpi/actbl1.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++-----
 include/acpi/actbl2.h | 14 +++++++++-
 2 files changed, 83 insertions(+), 8 deletions(-)
include/acpi/actbl1.h +70 -7
index 7a89e6de94da..ea0c71ece407 100644
@@ -69,9 +69,10 @@
 #define ACPI_SIG_HEST           "HEST"	/* Hardware Error Source Table */
 #define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
 #define ACPI_SIG_MSCT           "MSCT"	/* Maximum System Characteristics Table */
-#define ACPI_SIG_PDTT           "PDTT"	/* Processor Debug Trigger Table */
+#define ACPI_SIG_PDTT           "PDTT"	/* Platform Debug Trigger Table */
 #define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
 #define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
+#define ACPI_SIG_SDEV           "SDEV"	/* Secure Devices table */
 #define ACPI_SIG_SLIT           "SLIT"	/* System Locality Distance Information Table */
 #define ACPI_SIG_SRAT           "SRAT"	/* System Resource Affinity Table */
 #define ACPI_SIG_NFIT           "NFIT"	/* NVDIMM Firmware Interface Table */
@@ -1283,7 +1284,7 @@ struct acpi_nfit_flush_address {
 
 /*******************************************************************************
  *
- * PDTT - Processor Debug Trigger Table (ACPI 6.2)
+ * PDTT - Platform Debug Trigger Table (ACPI 6.2)
  *        Version 0
  *
  ******************************************************************************/
@@ -1301,14 +1302,14 @@ struct acpi_table_pdtt {
  * starting at array_offset.
  */
 struct acpi_pdtt_channel {
-	u16 sub_channel_id;
+	u8 subchannel_id;
+	u8 flags;
 };
 
-/* Mask and Flags for above */
+/* Flags for above */
 
-#define ACPI_PDTT_SUBCHANNEL_ID_MASK        0x00FF
-#define ACPI_PDTT_RUNTIME_TRIGGER           (1<<8)
-#define ACPI_PPTT_WAIT_COMPLETION           (1<<9)
+#define ACPI_PDTT_RUNTIME_TRIGGER           (1)
+#define ACPI_PPTT_WAIT_COMPLETION           (1<<1)
 
 /*******************************************************************************
  *
@@ -1405,6 +1406,68 @@ struct acpi_table_sbst {
 
 /*******************************************************************************
  *
+ * SDEV - Secure Devices Table (ACPI 6.2)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+struct acpi_table_sdev {
+	struct acpi_table_header header;	/* Common ACPI table header */
+};
+
+struct acpi_sdev_header {
+	u8 type;
+	u8 flags;
+	u16 length;
+};
+
+/* Values for subtable type above */
+
+enum acpi_sdev_type {
+	ACPI_SDEV_TYPE_NAMESPACE_DEVICE = 0,
+	ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
+	ACPI_SDEV_TYPE_RESERVED = 2	/* 2 and greater are reserved */
+};
+
+/* Values for flags above */
+
+#define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
+
+/*
+ * SDEV subtables
+ */
+
+/* 0: Namespace Device Based Secure Device Structure */
+
+struct acpi_sdev_namespace {
+	struct acpi_sdev_header header;
+	u16 device_id_offset;
+	u16 device_id_length;
+	u16 vendor_data_offset;
+	u16 vendor_data_length;
+};
+
+/* 1: PCIe Endpoint Device Based Device Structure */
+
+struct acpi_sdev_pcie {
+	struct acpi_sdev_header header;
+	u16 segment;
+	u16 start_bus;
+	u16 path_offset;
+	u16 path_length;
+	u16 vendor_data_offset;
+	u16 vendor_data_length;
+};
+
+/* 1a: PCIe Endpoint path entry */
+
+struct acpi_sdev_pcie_path {
+	u8 device;
+	u8 function;
+};
+
+/*******************************************************************************
+ *
  * SLIT - System Locality Distance Information Table
  *        Version 1
  *
include/acpi/actbl2.h +13 -1
index 686b6f8c09dc..2623f9d72e46 100644
@@ -1246,6 +1246,8 @@ enum acpi_spmi_interface_types {
  * TCPA - Trusted Computing Platform Alliance table
  *        Version 2
  *
+ * TCG Hardware Interface Table for TPM 1.2 Clients and Servers
+ *
  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
  * Version 1.2, Revision 8
  * February 27, 2017
@@ -1310,6 +1312,8 @@ struct acpi_table_tcpa_server {
  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
  *        Version 4
  *
+ * TCG Hardware Interface Table for TPM 2.0 Clients and Servers
+ *
  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
  * Version 1.2, Revision 8
  * February 27, 2017
@@ -1329,15 +1333,23 @@ struct acpi_table_tpm2 {
 /* Values for start_method above */
 
 #define ACPI_TPM2_NOT_ALLOWED                       0
+#define ACPI_TPM2_RESERVED1                         1
 #define ACPI_TPM2_START_METHOD                      2
+#define ACPI_TPM2_RESERVED3                         3
+#define ACPI_TPM2_RESERVED4                         4
+#define ACPI_TPM2_RESERVED5                         5
 #define ACPI_TPM2_MEMORY_MAPPED                     6
 #define ACPI_TPM2_COMMAND_BUFFER                    7
 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
+#define ACPI_TPM2_RESERVED9                         9
+#define ACPI_TPM2_RESERVED10                        10
 #define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC       11	/* V1.2 Rev 8 */
+#define ACPI_TPM2_RESERVED                          12
 
-/* Trailer appears after any start_method subtables */
+/* Optional trailer appears after any start_method subtables */
 
 struct acpi_tpm2_trailer {
+	u8 method_parameters[12];
 	u32 minimum_log_length;	/* Minimum length for the event log area */
 	u64 log_address;	/* Address of the event log area */
 };
Signature · 1 line
2.13.6
#10 lore raw

PATCH 10/11 ACPICA: Utilities: Cleanup style issue for bit clearing

In reply to Erik Schmauss

From: Lv Zheng <[email protected]>

ACPICA commit b49a0e1e26f3c61df7113f18f441c83739eb5514

It's reported in Linux community that change to utmath.c contains a style problem:
[.../utmath.c:137]: (style) Same expression on both sides of '^='. [.../utmath.c:174]: (style) Same expression on both sides of '^='.
This patch fixes this problem. ACPICA BZ 1422, reported by David Binderman, fixed by Lv Zheng.

---
 drivers/acpi/acpica/utmath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/utmath.c +2 -2
index 5f9c680076c4..2055a858e5f5 100644
@@ -134,7 +134,7 @@ acpi_status acpi_ut_short_shift_left(u64 operand, u32 count, u64 *out_result)
 
 	if ((count & 63) >= 32) {
 		operand_ovl.part.hi = operand_ovl.part.lo;
-		operand_ovl.part.lo ^= operand_ovl.part.lo;
+		operand_ovl.part.lo = 0;
 		count = (count & 63) - 32;
 	}
 	ACPI_SHIFT_LEFT_64_BY_32(operand_ovl.part.hi,
@@ -171,7 +171,7 @@ acpi_status acpi_ut_short_shift_right(u64 operand, u32 count, u64 *out_result)
 
 	if ((count & 63) >= 32) {
 		operand_ovl.part.lo = operand_ovl.part.hi;
-		operand_ovl.part.hi ^= operand_ovl.part.hi;
+		operand_ovl.part.hi = 0;
 		count = (count & 63) - 32;
 	}
 	ACPI_SHIFT_RIGHT_64_BY_32(operand_ovl.part.hi,
Signature · 1 line
2.13.6
#11 lore raw

PATCH 11/11 ACPICA: Update version to 20170929

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit 2399a7799d6e41ec5beca77ddff3acc77e1a4e0a

Version 20170929

---
 include/acpi/acpixf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 1a4322db0274..f25668cce946 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20170831
+#define ACPI_CA_VERSION                 0x20170929
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
2.13.6
#12 lore raw
In reply to Erik Schmauss

Hi Erik,

Quoted 37 lines · CET Erik Schmauss

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

 drivers/acpi/acpica/acapps.h             |  3 ++
 drivers/acpi/acpica/aclocal.h            |  2 +-
 drivers/acpi/acpica/dscontrol.c          | 18 ++++----
 drivers/acpi/acpica/hwtimer.c            | 29 ++++++------
 drivers/acpi/acpica/nsaccess.c           | 13 +++---
 drivers/acpi/acpica/nssearch.c           |  1 +
 drivers/acpi/acpica/psobject.c           | 10 +----
 drivers/acpi/acpica/psutils.c            |  6 +--
 drivers/acpi/acpica/utinit.c             |  1 -
 drivers/acpi/acpica/utmath.c             |  4 +-
Quoted 8 lines
 include/acpi/acconfig.h                  |  4 +-
 include/acpi/acexcep.h                   |  6 +--
 include/acpi/acpixf.h                    |  6 +--
 include/acpi/actbl1.h                    | 77 +++++++++++++++++++++++++++++---
 include/acpi/actbl2.h                    | 14 +++++-
 include/acpi/actypes.h                   |  2 +
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++--
 17 files changed, 160 insertions(+), 64 deletions(-)

Thanks for the patches.

It doesn't look like anything in this series and in the next one you posted is particularly urgent, so I'm going to queue them up for 4.16.

If there is anything is this material that should be included into 4.15, please let me know.

Thanks,
Rafael

#13 lore raw
Quoted 59 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Rafael J. Wysocki
Sent: Monday, November 20, 2017 5:05 PM
To: Schmauss, Erik <[email protected]>
Cc: [email protected]; Moore, Robert <[email protected]>
Subject: Re: [PATCH 00/11] ACPICA release 20170929

Hi Erik,

Quoted 37 lines · CET Erik Schmauss

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

 drivers/acpi/acpica/acapps.h             |  3 ++
 drivers/acpi/acpica/aclocal.h            |  2 +-
 drivers/acpi/acpica/dscontrol.c          | 18 ++++----
 drivers/acpi/acpica/hwtimer.c            | 29 ++++++------
 drivers/acpi/acpica/nsaccess.c           | 13 +++---
 drivers/acpi/acpica/nssearch.c           |  1 +
 drivers/acpi/acpica/psobject.c           | 10 +----
 drivers/acpi/acpica/psutils.c            |  6 +--
 drivers/acpi/acpica/utinit.c             |  1 -
 drivers/acpi/acpica/utmath.c             |  4 +-
Quoted 8 lines
 include/acpi/acconfig.h                  |  4 +-
 include/acpi/acexcep.h                   |  6 +--
 include/acpi/acpixf.h                    |  6 +--
 include/acpi/actbl1.h                    | 77 +++++++++++++++++++++++++++++---
 include/acpi/actbl2.h                    | 14 +++++-
 include/acpi/actypes.h                   |  2 +
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++--
 17 files changed, 160 insertions(+), 64 deletions(-)
Quoted 7 lines

Thanks for the patches.

It doesn't look like anything in this series and in the next one you posted is particularly urgent, so I'm going to queue them up for 4.16.

If there is anything is this material that should be included into 4.15, please let me know.

Hi Rafael,

This 20170927 release was a small one and I believe that all of these are not very urgent. However, changes to the NFIT table in the 20171110 release has been requested by a few customers

Thanks,
Erik

Quoted 8 lines

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#14 lore raw
Quoted 59 lines · Erik
Quoted 59 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Rafael J. Wysocki
Sent: Monday, November 20, 2017 5:05 PM
To: Schmauss, Erik <[email protected]>
Cc: [email protected]; Moore, Robert <[email protected]>
Subject: Re: [PATCH 00/11] ACPICA release 20170929

Hi Erik,

Quoted 45 lines · CET Erik Schmauss

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

 drivers/acpi/acpica/acapps.h             |  3 ++
 drivers/acpi/acpica/aclocal.h            |  2 +-
 drivers/acpi/acpica/dscontrol.c          | 18 ++++----
 drivers/acpi/acpica/hwtimer.c            | 29 ++++++------
 drivers/acpi/acpica/nsaccess.c           | 13 +++---
 drivers/acpi/acpica/nssearch.c           |  1 +
 drivers/acpi/acpica/psobject.c           | 10 +----
 drivers/acpi/acpica/psutils.c            |  6 +--
 drivers/acpi/acpica/utinit.c             |  1 -
 drivers/acpi/acpica/utmath.c             |  4 +-
 include/acpi/acconfig.h                  |  4 +-
 include/acpi/acexcep.h                   |  6 +--
 include/acpi/acpixf.h                    |  6 +--
 include/acpi/actbl1.h                    | 77 +++++++++++++++++++++++++++++---
 include/acpi/actbl2.h                    | 14 +++++-
 include/acpi/actypes.h                   |  2 +
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++--
 17 files changed, 160 insertions(+), 64 deletions(-)
Quoted 8 lines
Quoted 7 lines

Thanks for the patches.

It doesn't look like anything in this series and in the next one you posted is particularly urgent, so I'm going to queue them up for 4.16.

If there is anything is this material that should be included into 4.15, please let me know.

Hi Rafael,

Hi Erik,

Quoted 1 line

This 20170927 release was a small one and I believe that all of these are not very urgent. However, changes to the NFIT table in the 20171110 release has been requested by a few customers

Well, I was asking about bug fixes rather as I'm not going to stretch the rules and fast-track new material that has only been posted after the opening of the merge window.

So let me rephrase: out of the fixes included in the two releases in question, is there anything urgent enough that it should be pushed for 4.15?

Thanks,
Rafael

#15 lore raw
Quoted 74 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rafael J. Wysocki
Sent: Tuesday, November 21, 2017 2:42 PM
To: Schmauss, Erik <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>; [email protected]; Moore, Robert <[email protected]>
Subject: Re: [PATCH 00/11] ACPICA release 20170929

Quoted 62 lines · Erik
Quoted 62 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Rafael J. Wysocki
Sent: Monday, November 20, 2017 5:05 PM
To: Schmauss, Erik <[email protected]>
Cc: [email protected]; Moore, Robert <[email protected]>
Subject: Re: [PATCH 00/11] ACPICA release 20170929

Hi Erik,

Quoted 37 lines · CET Erik Schmauss

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

 drivers/acpi/acpica/acapps.h             |  3 ++
 drivers/acpi/acpica/aclocal.h            |  2 +-
 drivers/acpi/acpica/dscontrol.c          | 18 ++++----
 drivers/acpi/acpica/hwtimer.c            | 29 ++++++------
 drivers/acpi/acpica/nsaccess.c           | 13 +++---
 drivers/acpi/acpica/nssearch.c           |  1 +
 drivers/acpi/acpica/psobject.c           | 10 +----
 drivers/acpi/acpica/psutils.c            |  6 +--
 drivers/acpi/acpica/utinit.c             |  1 -
 drivers/acpi/acpica/utmath.c             |  4 +-
Quoted 8 lines
 include/acpi/acconfig.h                  |  4 +-
 include/acpi/acexcep.h                   |  6 +--
 include/acpi/acpixf.h                    |  6 +--
 include/acpi/actbl1.h                    | 77 +++++++++++++++++++++++++++++---
 include/acpi/actbl2.h                    | 14 +++++-
 include/acpi/actypes.h                   |  2 +
 tools/power/acpi/tools/acpidump/apmain.c | 28 ++++++++++--
 17 files changed, 160 insertions(+), 64 deletions(-)

Thanks for the patches.

Quoted 13 lines
Quoted 6 lines
Quoted 5 lines

It doesn't look like anything in this series and in the next one you posted is particularly urgent, so I'm going to queue them up for 4.16.

If there is anything is this material that should be included into 4.15, please let me know.

Hi Rafael,

Hi Erik,

Quoted 3 lines

This 20170927 release was a small one and I believe that all of these are not very urgent. However, changes to the NFIT table in the 20171110 release has been requested by a few customers

Hi Rafael,

Quoted 6 lines

Well, I was asking about bug fixes rather as I'm not going to stretch the rules and fast-track new material that has only been posted after the opening of the merge window.

So let me rephrase: out of the fixes included in the two releases in question, is there anything urgent enough that it should be pushed for 4.15?

Thanks for the clarification. In this case, no. We don't have any fixes that are urgent enough to be pushed for 4.15.

Thanks,
Erik

Quoted 3 lines

Thanks,
Rafael

#16 lore raw
In reply to Erik Schmauss
Quoted 19 lines · CET Erik Schmauss

This series of patches are from the 20170929 release of ACPICA. This set is meant to be applied on top of the 20170831 ACPICA release.

Bob Moore (4):
ACPICA: Rename AE_AML_INFINITE_LOOP exception
ACPICA: Tools: Deploy -vd option (build date/time) across all tools
ACPICA: iASL/Tools: Add support for PDTT,SDEV,TPM2 ACPI tables
ACPICA: Update version to 20170929

Colin Ian King (1):
ACPICA: Avoid null pointer dereference on Op.

Erik Schmauss (3):
ACPICA: Disassembler: reset parser_state's Aml pointer when parsing
bad externals
ACPICA: disassembler: getting rid of error message
ACPICA: iASL: change processing of external op namespace nodes for
correctness

Quoted 7 lines

Jung-uk Kim (1):
ACPICA: Fix an off-by-one error in acpi_get_timer_duration().

Lv Zheng (2):
ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop
detection
ACPICA: Utilities: Cleanup style issue for bit clearing

Series applied, thanks!

Rafael