Skip to contentSkip to conversation

ACPICA release 20180208v2

PATCH In review Erik Schmauss 5 participants 17 messages Feb 15, 2018 – Apr 17, 2018 9 messages not in the archive

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

v2 cover ACPICA release 20180208v2

v2 of the patch set. Apparently, a patch was left off due to issues with my mail client...

This is the ACPICA20180212 release.

Notable commits are changes made to integrate package handling with MLC and setting the TermList parsing as a default. A small commit was made to disable package resolution errors. This reverts the error reporting behavior to match the previous behavior (in 4.13)

Bob Moore (5):
ACPICA: Update error message, no functional change
ACPICA: Update for some debug output. No functional change
ACPICA: Revert "Fix for implicit result conversion for the ToXXXX
functions"
ACPICA: Add option to disable Package object name resolution errors
ACPICA: Update version to 20180209

Erik Schmauss (2):
ACPICA: Restructure ACPI table files
ACPICA: Integrate package handling with module-level code

 drivers/acpi/acpica/acopcode.h  |   14 +-
 drivers/acpi/acpica/amlcode.h   |   20 +-
 drivers/acpi/acpica/dsargs.c    |    1 +
 drivers/acpi/acpica/dsopcode.c  |    4 +-
 drivers/acpi/acpica/dspkginit.c |  164 ++--
 drivers/acpi/acpica/dswexec.c   |    6 +-
 drivers/acpi/acpica/dswload.c   |    2 +-
 drivers/acpi/acpica/exconvrt.c  |    1 +
 drivers/acpi/acpica/exnames.c   |    7 +-
 drivers/acpi/acpica/exresop.c   |    1 +
 drivers/acpi/acpica/nseval.c    |    8 +-
 drivers/acpi/acpica/nsinit.c    |    7 +-
 drivers/acpi/acpica/nsnames.c   |    3 +
 drivers/acpi/acpica/nsparse.c   |   10 +-
 drivers/acpi/acpica/psloop.c    |    4 +-
 drivers/acpi/acpica/psparse.c   |    2 +-
 drivers/acpi/acpica/pstree.c    |    1 +
 drivers/acpi/acpica/utcache.c   |    7 +-
 drivers/acpi/acpica/utdelete.c  |   20 +-
 include/acpi/acpixf.h           |   10 +-
 include/acpi/actbl1.h           | 1638 ++++++++++++++++----------------
 include/acpi/actbl2.h           | 1964 +++++++++++++++++++++------------------
 include/acpi/actbl3.h           | 1016 +++++++++-----------
 include/acpi/platform/aclinux.h |    1 +
 24 files changed, 2477 insertions(+), 2434 deletions(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 2/7 ACPICA: Update error message, no functional change

From: Bob Moore <[email protected]>

ACPICA commit 0787fda3b224a78369e26ac6046658beb2b64c12

Clarify error when an attempt is made to evaluate things like devices, events, etc. -- these objects have no data and cannot be "evaluated".

---
 drivers/acpi/acpica/nseval.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/acpi/acpica/nseval.c +5 -3
index c2d883b8c45e..bdf94ec19c10 100644
@@ -187,6 +187,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
 	 * 3) The object is not a method -- just return it's current value
 	 */
 	switch (acpi_ns_get_type(info->node)) {
+	case ACPI_TYPE_ANY:
 	case ACPI_TYPE_DEVICE:
 	case ACPI_TYPE_EVENT:
 	case ACPI_TYPE_MUTEX:
@@ -194,11 +195,12 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
 	case ACPI_TYPE_THERMAL:
 	case ACPI_TYPE_LOCAL_SCOPE:
 		/*
-		 * 1) Disallow evaluation of certain object types. For these,
-		 *    object evaluation is undefined and not supported.
+		 * 1) Disallow evaluation of these object types. For these,
+		 *    object evaluation is undefined.
 		 */
 		ACPI_ERROR((AE_INFO,
-			    "%s: Evaluation of object type [%s] is not supported",
+			    "%s: This object type [%s] "
+			    "never contains data and cannot be evaluated",
 			    info->full_pathname,
 			    acpi_ut_get_type_name(info->node->type)));
 
Signature · 1 line
2.14.3
#2 lore raw

PATCH v2 3/7 ACPICA: Update for some debug output. No functional change

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit 3a08436fe3bff297a6de162252964e955946c7d3

Improve/simplify some of the debug messages.

---
 drivers/acpi/acpica/dsargs.c   |  1 +
 drivers/acpi/acpica/dsopcode.c |  4 ++--
 drivers/acpi/acpica/dswload.c  |  2 +-
 drivers/acpi/acpica/exnames.c  |  7 ++-----
 drivers/acpi/acpica/nsinit.c   |  7 ++++++-
 drivers/acpi/acpica/nsnames.c  |  3 +++
 drivers/acpi/acpica/nsparse.c  |  9 ++++++---
 drivers/acpi/acpica/psloop.c   |  4 ++--
 drivers/acpi/acpica/psparse.c  |  2 +-
 drivers/acpi/acpica/utcache.c  |  7 ++++---
 drivers/acpi/acpica/utdelete.c | 20 ++++++++++++--------
 11 files changed, 40 insertions(+), 26 deletions(-)
drivers/acpi/acpica/dsargs.c +1 -0
index 04a9f60e7ad1..a164b1530eec 100644
@@ -346,6 +346,7 @@ acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc)
 	status = acpi_ds_execute_arguments(node, node,
 					   obj_desc->package.aml_length,
 					   obj_desc->package.aml_start);
+
 	return_ACPI_STATUS(status);
 }
 
drivers/acpi/acpica/dsopcode.c +2 -2
index 0181cd317751..84667c9055cb 100644
@@ -603,8 +603,8 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
 
 	if (!op->common.value.arg) {
 		ACPI_ERROR((AE_INFO,
-			    "Dispatch: Missing child while executing TermArg for %X",
-			    op->common.aml_opcode));
+			    "Missing child while evaluating opcode %4.4X, Op %p",
+			    op->common.aml_opcode, op));
 		return_ACPI_STATUS(AE_OK);
 	}
 
drivers/acpi/acpica/dswload.c +1 -1
index fa4ef9229e17..be1410f4755f 100644
@@ -147,7 +147,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
 	char *path;
 	u32 flags;
 
-	ACPI_FUNCTION_TRACE(ds_load1_begin_op);
+	ACPI_FUNCTION_TRACE_PTR(ds_load1_begin_op, walk_state->op);
 
 	op = walk_state->op;
 	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op,
drivers/acpi/acpica/exnames.c +2 -5
index c7b249cda5c0..6dc2682cbbea 100644
@@ -174,13 +174,10 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
 		return_ACPI_STATUS(AE_CTRL_PENDING);
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Bytes from stream:\n"));
-
 	for (index = 0;
 	     (index < ACPI_NAME_SIZE)
 	     && (acpi_ut_valid_name_char(*aml_address, 0)); index++) {
 		char_buf[index] = *aml_address++;
-		ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index]));
 	}
 
 	/* Valid name segment  */
@@ -192,9 +189,9 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
 		char_buf[4] = '\0';
 
 		if (name_string) {
-			strcat(name_string, char_buf);
 			ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
-					  "Appended to - %s\n", name_string));
+					  "Appending NameSeg %s\n", char_buf));
+			strcat(name_string, char_buf);
 		} else {
 			ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
 					  "No Name string - %s\n", char_buf));
drivers/acpi/acpica/nsinit.c +6 -1
index c17af4a3ab67..93697527036d 100644
@@ -286,7 +286,7 @@ acpi_status acpi_ns_initialize_devices(u32 flags)
  * RETURN:      Status
  *
  * DESCRIPTION: Callback from acpi_walk_namespace. Invoked for every object
- *              within the  namespace.
+ *              within the namespace.
  *
  *              Currently, the only objects that require initialization are:
  *              1) Methods
@@ -400,6 +400,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
 			break;
 		}
 
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+				      "%s: Completing resolution of Package elements\n",
+				      ACPI_GET_FUNCTION_NAME));
+
 		/*
 		 * Resolve all named references in package objects (and all
 		 * sub-packages). This action has been deferred until the entire
@@ -409,6 +413,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
 		status = acpi_ut_walk_package_tree(obj_desc, NULL,
 						   acpi_ds_init_package_element,
 						   NULL);
+
 		obj_desc->package.flags |= AOPOBJ_DATA_VALID;
 		break;
 
drivers/acpi/acpica/nsnames.c +3 -0
index c686eda7ca66..5d3bfaa6c035 100644
@@ -354,6 +354,9 @@ char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
 	(void)acpi_ns_build_normalized_path(node, name_buffer, size,
 					    no_trailing);
 
+	ACPI_DEBUG_PRINT_RAW((ACPI_DB_NAMES, "%s: Path \"%s\"\n",
+			      ACPI_GET_FUNCTION_NAME, name_buffer));
+
 	return_PTR(name_buffer);
 }
 
drivers/acpi/acpica/nsparse.c +6 -3
index c5b22ea5b369..6ac2d26a2cfb 100644
@@ -112,8 +112,10 @@ acpi_ns_execute_table(u32 table_index, struct acpi_namespace_node *start_node)
 		goto cleanup;
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-			  "Create table code block: %p\n", method_obj));
+	ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+			      "%s: Create table pseudo-method for [%4.4s] @%p, method %p\n",
+			      ACPI_GET_FUNCTION_NAME, table->signature, table,
+			      method_obj));
 
 	method_obj->method.aml_start = aml_start;
 	method_obj->method.aml_length = aml_length;
@@ -265,7 +267,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
 	ACPI_FUNCTION_TRACE(ns_parse_table);
 
 	if (acpi_gbl_parse_table_as_term_list) {
-		ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start load pass\n"));
+		ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
+				  "**** Start table execution pass\n"));
 
 		status = acpi_ns_execute_table(table_index, start_node);
 		if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/psloop.c +2 -2
index 7dca287d7690..569df3cc6cb5 100644
@@ -165,7 +165,7 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
 		}
 
 		ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-				  "Final argument count: %u pass %u\n",
+				  "Final argument count: %8.8X pass %u\n",
 				  walk_state->arg_count,
 				  walk_state->pass_number));
 
@@ -581,7 +581,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
 		/* Check for arguments that need to be processed */
 
 		ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-				  "Parseloop: argument count: %u\n",
+				  "Parseloop: argument count: %8.8X\n",
 				  walk_state->arg_count));
 
 		if (walk_state->arg_count) {
drivers/acpi/acpica/psparse.c +1 -1
index 2474ff961294..b10fb68eb83d 100644
@@ -454,7 +454,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 			  walk_state->parser_state.aml_size));
 
 	if (!walk_state->parser_state.aml) {
-		return_ACPI_STATUS(AE_NULL_OBJECT);
+		return_ACPI_STATUS(AE_BAD_ADDRESS);
 	}
 
 	/* Create and initialize a new thread state */
drivers/acpi/acpica/utcache.c +4 -3
index 08e6944404b3..3ec7e8aca325 100644
@@ -269,9 +269,10 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
 		cache->current_depth--;
 
 		ACPI_MEM_TRACKING(cache->hits++);
-		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-				  "Object %p from %s cache\n", object,
-				  cache->list_name));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_EXEC,
+				      "%s: Object %p from %s cache\n",
+				      ACPI_GET_FUNCTION_NAME, object,
+				      cache->list_name));
 
 		status = acpi_ut_release_mutex(ACPI_MTX_CACHES);
 		if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/utdelete.c +12 -8
index 7d8d0208f0a3..db98f0d991f7 100644
@@ -332,8 +332,10 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
 
 	/* Now the object can be safely deleted */
 
-	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Deleting Object %p [%s]\n",
-			  object, acpi_ut_get_object_type_name(object)));
+	ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS,
+			      "%s: Deleting Object %p [%s]\n",
+			      ACPI_GET_FUNCTION_NAME, object,
+			      acpi_ut_get_object_type_name(object)));
 
 	acpi_ut_delete_object_desc(object);
 	return_VOID;
@@ -444,9 +446,10 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
 				      object));
 		}
 
-		ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
-				  "Obj %p Type %.2X Refs %.2X [Decremented]\n",
-				  object, object->common.type, new_count));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS,
+				      "%s: Obj %p Type %.2X Refs %.2X [Decremented]\n",
+				      ACPI_GET_FUNCTION_NAME, object,
+				      object->common.type, new_count));
 
 		/* Actually delete the object on a reference count of zero */
 
@@ -747,9 +750,10 @@ void acpi_ut_remove_reference(union acpi_operand_object *object)
 		return;
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
-			  "Obj %p Current Refs=%X [To Be Decremented]\n",
-			  object, object->common.reference_count));
+	ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS,
+			      "%s: Obj %p Current Refs=%X [To Be Decremented]\n",
+			      ACPI_GET_FUNCTION_NAME, object,
+			      object->common.reference_count));
 
 	/*
 	 * Decrement the reference count, and only actually delete the object
Signature · 1 line
2.14.3
#3 lore raw

PATCH v2 5/7 ACPICA: Integrate package handling with module-level code

In reply to Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)
{
Name(OBJ1, 0)

if (1)

  {
    Device (DEV1)
    {
      Name (_HID,0x0)
    }
  }
  Scope (DEV1)
  {
    Name (OBJ2)

}
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

ACPICA repo:

---
 drivers/acpi/acpica/dspkginit.c | 128 ++++++++++++++++++++++------------------
 drivers/acpi/acpica/dswexec.c   |   6 +-
 drivers/acpi/acpica/nsparse.c   |   5 +-
 drivers/acpi/acpica/pstree.c    |   1 +
 include/acpi/acpixf.h           |   8 ++-
 5 files changed, 85 insertions(+), 63 deletions(-)
drivers/acpi/acpica/dspkginit.c +71 -57
index 902bee78036c..a307a07aeacd 100644
@@ -47,6 +47,7 @@
 #include "amlcode.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acparser.h"
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("dspkginit")
@@ -94,12 +95,19 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 	union acpi_parse_object *parent;
 	union acpi_operand_object *obj_desc = NULL;
 	acpi_status status = AE_OK;
+	u8 module_level_code = FALSE;
 	u16 reference_count;
 	u32 index;
 	u32 i;
 
 	ACPI_FUNCTION_TRACE(ds_build_internal_package_obj);
 
+	/* Check if we are executing module level code */
+
+	if (walk_state->parse_flags & ACPI_PARSE_MODULE_LEVEL) {
+		module_level_code = TRUE;
+	}
+
 	/* Find the parent of a possibly nested package */
 
 	parent = op->common.parent;
@@ -130,24 +138,44 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 
 	/*
 	 * Allocate the element array (array of pointers to the individual
-	 * objects) based on the num_elements parameter. Add an extra pointer slot
-	 * so that the list is always null terminated.
+	 * objects) if necessary. the count is based on the num_elements
+	 * parameter. Add an extra pointer slot so that the list is always
+	 * null terminated.
 	 */
-	obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
-							   element_count +
-							   1) * sizeof(void *));
-
 	if (!obj_desc->package.elements) {
-		acpi_ut_delete_object_desc(obj_desc);
-		return_ACPI_STATUS(AE_NO_MEMORY);
+		obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
+								   element_count
+								   +
+								   1) *
+								  sizeof(void
+									 *));
+
+		if (!obj_desc->package.elements) {
+			acpi_ut_delete_object_desc(obj_desc);
+			return_ACPI_STATUS(AE_NO_MEMORY);
+		}
+
+		obj_desc->package.count = element_count;
 	}
 
-	obj_desc->package.count = element_count;
+	/* First arg is element count. Second arg begins the initializer list */
+
 	arg = op->common.value.arg;
 	arg = arg->common.next;
 
-	if (arg) {
-		obj_desc->package.flags |= AOPOBJ_DATA_VALID;
+	/*
+	 * If we are executing module-level code, we will defer the
+	 * full resolution of the package elements in order to support
+	 * forward references from the elements. This provides
+	 * compatibility with other ACPI implementations.
+	 */
+	if (module_level_code) {
+		obj_desc->package.aml_start = walk_state->aml;
+		obj_desc->package.aml_length = 0;
+
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+				      "%s: Deferring resolution of Package elements\n",
+				      ACPI_GET_FUNCTION_NAME));
 	}
 
 	/*
@@ -187,15 +215,19 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 					    "****DS namepath not found"));
 			}
 
-			/*
-			 * Initialize this package element. This function handles the
-			 * resolution of named references within the package.
-			 */
-			acpi_ds_init_package_element(0,
-						     obj_desc->package.
-						     elements[i], NULL,
-						     &obj_desc->package.
-						     elements[i]);
+			if (!module_level_code) {
+				/*
+				 * Initialize this package element. This function handles the
+				 * resolution of named references within the package.
+				 * Forward references from module-level code are deferred
+				 * until all ACPI tables are loaded.
+				 */
+				acpi_ds_init_package_element(0,
+							     obj_desc->package.
+							     elements[i], NULL,
+							     &obj_desc->package.
+							     elements[i]);
+			}
 		}
 
 		if (*obj_desc_ptr) {
@@ -265,15 +297,21 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
 		 * num_elements count.
 		 *
 		 * Note: this is not an error, the package is padded out
-		 * with NULLs.
+		 * with NULLs as per the ACPI specification.
 		 */
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-				  "Package List length (%u) smaller than NumElements "
-				  "count (%u), padded with null elements\n",
-				  i, element_count));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO,
+				      "%s: Package List length (%u) smaller than NumElements "
+				      "count (%u), padded with null elements\n",
+				      ACPI_GET_FUNCTION_NAME, i,
+				      element_count));
+	}
+
+	/* Module-level packages will be resolved later */
+
+	if (!module_level_code) {
+		obj_desc->package.flags |= AOPOBJ_DATA_VALID;
 	}
 
-	obj_desc->package.flags |= AOPOBJ_DATA_VALID;
 	op->common.node = ACPI_CAST_PTR(struct acpi_namespace_node, obj_desc);
 	return_ACPI_STATUS(status);
 }
@@ -363,6 +401,10 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 	/* Check if reference element is already resolved */
 
 	if (element->reference.resolved) {
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+				      "%s: Package element is already resolved\n",
+				      ACPI_GET_FUNCTION_NAME));
+
 		return_VOID;
 	}
 
@@ -383,7 +425,10 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 				"Could not find/resolve named package element: %s",
 				external_path));
 
+		/* Not found, set the element to NULL */
+
 		ACPI_FREE(external_path);
+		acpi_ut_remove_reference(*element_ptr);
 		*element_ptr = NULL;
 		return_VOID;
 	} else if (resolved_node->type == ACPI_TYPE_ANY) {
@@ -397,23 +442,6 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 		*element_ptr = NULL;
 		return_VOID;
 	}
-#if 0
-	else if (resolved_node->flags & ANOBJ_TEMPORARY) {
-		/*
-		 * A temporary node found here indicates that the reference is
-		 * to a node that was created within this method. We are not
-		 * going to allow it (especially if the package is returned
-		 * from the method) -- the temporary node will be deleted out
-		 * from under the method. (05/2017).
-		 */
-		ACPI_ERROR((AE_INFO,
-			    "Package element refers to a temporary name [%4.4s], "
-			    "inserting a NULL element",
-			    resolved_node->name.ascii));
-		*element_ptr = NULL;
-		return_VOID;
-	}
-#endif
 
 	/*
 	 * Special handling for Alias objects. We need resolved_node to point
@@ -449,20 +477,6 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 	if (ACPI_FAILURE(status)) {
 		return_VOID;
 	}
-#if 0
-/* TBD - alias support */
-	/*
-	 * Special handling for Alias objects. We need to setup the type
-	 * and the Op->Common.Node to point to the Alias target. Note,
-	 * Alias has at most one level of indirection internally.
-	 */
-	type = op->common.node->type;
-	if (type == ACPI_TYPE_LOCAL_ALIAS) {
-		type = obj_desc->common.type;
-		op->common.node = ACPI_CAST_PTR(struct acpi_namespace_node,
-						op->common.node->object);
-	}
-#endif
 
 	switch (type) {
 		/*
drivers/acpi/acpica/dswexec.c +4 -2
index 2c07d220a50f..46962e34fc02 100644
@@ -576,8 +576,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
 		case AML_TYPE_CREATE_OBJECT:
 
 			ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-					  "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
-					  op, op->named.data));
+					  "Executing CreateObject (Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",
+					  op, op->named.value.arg,
+					  op->common.parent->common.
+					  aml_opcode));
 
 			switch (op->common.parent->common.aml_opcode) {
 			case AML_NAME_OP:
drivers/acpi/acpica/nsparse.c +3 -2
index 6ac2d26a2cfb..acb1aede720e 100644
@@ -267,8 +267,9 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
 	ACPI_FUNCTION_TRACE(ns_parse_table);
 
 	if (acpi_gbl_parse_table_as_term_list) {
-		ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-				  "**** Start table execution pass\n"));
+		ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+				      "%s: **** Start table execution pass\n",
+				      ACPI_GET_FUNCTION_NAME));
 
 		status = acpi_ns_execute_table(table_index, start_node);
 		if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/pstree.c +1 -0
index f9fa88c79b32..a4dd08eca47c 100644
@@ -295,6 +295,7 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op)
 
 	case AML_BUFFER_OP:
 	case AML_PACKAGE_OP:
+	case AML_VARIABLE_PACKAGE_OP:
 	case AML_METHOD_OP:
 	case AML_IF_OP:
 	case AML_WHILE_OP:
include/acpi/acpixf.h +6 -2
index c2bf1255f5aa..84c946882589 100644
@@ -192,15 +192,19 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
 
 /*
  * Optionally support group module level code.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
  */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, FALSE);
 
 /*
  * Optionally support module level code by parsing the entire table as
  * a term_list. Default is FALSE, do not execute entire table until some
  * lock order issues are fixed.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
  */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, FALSE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, TRUE);
 
 /*
  * Optionally use 32-bit FADT addresses if and when there is a conflict
Signature · 1 line
2.14.3

A message that is not in the archive (sent off-list or not yet received): 20180215210932.15490-6-erik.schmauss-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#5 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

[ adding linux-nvdimm ]

Quoted 50 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Hi,

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

Expect:

# ndctl list -BR
[
   {
     "provider":"ACPI.NFIT",
     "dev":"ndbus1",
     "regions":[
       {
         "dev":"region1",
         "size":33285996544,
         "available_size":0,
         "type":"pmem",
         "numa_node":0,
         "iset_id":52512752653219036,
         "persistence_domain":"unknown"
       },
       {
         "dev":"region2",
         "size":33285996544,
         "available_size":0,
         "type":"pmem",
         "numa_node":0,
         "iset_id":52512795602891997,
         "persistence_domain":"unknown"
       }
     ]
   },
   {
     "provider":"e820",
     "dev":"ndbus0",
     "regions":[
       {
         "dev":"region0",
         "size":4294967296,
         "available_size":0,
         "type":"pmem",
         "persistence_domain":"unknown"
       }
     ]
   }
]

Actual:

# ndctl list -BR
{
   "provider":"e820",
   "dev":"ndbus0",
   "regions":[
     {
       "dev":"region0",
       "size":4294967296,
       "available_size":0,
       "type":"pmem",
       "persistence_domain":"unknown"
     }
   ]
}

The immediately preceding commit 7decc66df940 ("ACPICA: Revert "Fix for implicit result conversion for the To____ functions"") works fine.

Commit 5a8361f7ecce does not revert cleanly. Here is my qemu-kvm command line:

label_size=$((128*1024))
mem_size=$((31 << 30))

kvm=(

         $qemu
         -enable-kvm
         -cpu kvm64
         -kernel $kernel
         -initrd $initrd
         -m 16G,slots=4,maxmem=128G

         -machine pc-i440fx-2.4,accel=kvm,usb=off,vmport=off,nvdimm
         -cpu SandyBridge
         -smp 40
         -netdev tap,id=hostnet0,ifname=tap0,script=no,downscript=no
         -device

virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:b7:a1:ad,bus=pci.0,addr=0x7
-object
memory-backend-file,id=mem1,share,mem-path=${mem}1,size=$((label_size + mem_size))

         -device nvdimm,memdev=mem1,id=nv1,label-size=${label_size}

         -object
memory-backend-file,id=mem2,share,mem-path=${mem}2,size=$((label_size +
mem_size))
         -device nvdimm,memdev=mem2,id=nv2,label-size=${label_size}
         -numa node
         -numa node
         -device ahci,id=sata0,bus=pci.0,addr=0x8
         -drive file=$IMAGE,if=none,id=drive-sata0-0-0,format=raw
         -device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0
         -boot order=nc
         -no-reboot
         -watchdog i6300esb
         -rtc base=localtime
         -serial stdio
         -display none
         -monitor null

)

...where the important lines that setup the pmem emulation are:

-object
memory-backend-file,id=mem1,share,mem-path=${mem}1,size=$((label_size + mem_size))

         -device nvdimm,memdev=mem1,id=nv1,label-size=${label_size}

         -object
memory-backend-file,id=mem2,share,mem-path=${mem}2,size=$((label_size +
mem_size))
         -device nvdimm,memdev=mem2,id=nv2,label-size=${label_size}

My qemu-kvm version is: v2.7.0-1059-g63e18bdfd8a0

Let me know if you need any more information or help getting the kvm setup going.

Quoted 2 lines
---
  drivers/acpi/acpica/dspkginit.c | 128

++++++++++++++++++++++------------------

Review

Quoted 7 lines
  drivers/acpi/acpica/dswexec.c   |   6 +-
  drivers/acpi/acpica/nsparse.c   |   5 +-
  drivers/acpi/acpica/pstree.c    |   1 +
  include/acpi/acpixf.h           |   8 ++-
  5 files changed, 85 insertions(+), 63 deletions(-)
(quoted diff) +0 -0

b/drivers/acpi/acpica/dspkginit.c

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct

Quoted 12 lines

index 902bee78036c..a307a07aeacd 100644

drivers/acpi/acpica/dspkginit.c +1 -0
@@ -47,6 +47,7 @@
  #include "amlcode.h"
  #include "acdispat.h"
  #include "acinterp.h"
+#include "acparser.h"
 
  #define _COMPONENT          ACPI_NAMESPACE
  ACPI_MODULE_NAME("dspkginit")
@@ -94,12 +95,19 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct

Quoted 20 lines
drivers/acpi/acpica/dspkginit.c +7 -0
         union acpi_parse_object *parent;
         union acpi_operand_object *obj_desc = NULL;
         acpi_status status = AE_OK;
+       u8 module_level_code = FALSE;
         u16 reference_count;
         u32 index;
         u32 i;
 
         ACPI_FUNCTION_TRACE(ds_build_internal_package_obj);
 
+       /* Check if we are executing module level code */
+
+       if (walk_state->parse_flags & ACPI_PARSE_MODULE_LEVEL) {
+               module_level_code = TRUE;
+       }
+
         /* Find the parent of a possibly nested package */
 
         parent = op->common.parent;
@@ -130,24 +138,44 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 3 lines
drivers/acpi/acpica/dspkginit.c +0 -1
         /*
          * Allocate the element array (array of pointers to the individual
-        * objects) based on the num_elements parameter. Add an extra

pointer slot

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 8 lines
drivers/acpi/acpica/dspkginit.c +3 -4
-        * so that the list is always null terminated.
+        * objects) if necessary. the count is based on the num_elements
+        * parameter. Add an extra pointer slot so that the list is always
+        * null terminated.
          */
-       obj_desc->package.elements = ACPI_ALLOCATE_ZEROED(((acpi_size)
-                                                          element_count +
-                                                          1) *

sizeof(void *));

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 5 lines
drivers/acpi/acpica/dspkginit.c +1 -3
-
         if (!obj_desc->package.elements) {
-               acpi_ut_delete_object_desc(obj_desc);
-               return_ACPI_STATUS(AE_NO_MEMORY);
+               obj_desc->package.elements =

ACPI_ALLOCATE_ZEROED(((acpi_size)

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 146

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+

element_count

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, · line 152

Quoted 3 lines
drivers/acpi/acpica/dspkginit.c +3 -0
+                                                                  +
+                                                                  1) *
+

sizeof(void

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 150

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+

*));

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 11 lines
drivers/acpi/acpica/dspkginit.c +8 -1
+
+               if (!obj_desc->package.elements) {
+                       acpi_ut_delete_object_desc(obj_desc);
+                       return_ACPI_STATUS(AE_NO_MEMORY);
+               }
+
+               obj_desc->package.count = element_count;
         }
 
-       obj_desc->package.count = element_count;
+       /* First arg is element count. Second arg begins the initializer

list */

Quoted 8 lines
drivers/acpi/acpica/dspkginit.c +3 -2
+
         arg = op->common.value.arg;
         arg = arg->common.next;
 
-       if (arg) {
-               obj_desc->package.flags |= AOPOBJ_DATA_VALID;
+       /*
+        * If we are executing module-level code, we will defer the

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 10 lines
drivers/acpi/acpica/dspkginit.c +10 -0
+        * full resolution of the package elements in order to support
+        * forward references from the elements. This provides
+        * compatibility with other ACPI implementations.
+        */
+       if (module_level_code) {
+               obj_desc->package.aml_start = walk_state->aml;
+               obj_desc->package.aml_length = 0;
+
+               ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+                                     "%s: Deferring resolution of

Package elements\n",

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct

Quoted 5 lines
drivers/acpi/acpica/dspkginit.c +1 -0
+                                     ACPI_GET_FUNCTION_NAME));
         }
 
         /*
@@ -187,15 +215,19 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 5 lines
drivers/acpi/acpica/dspkginit.c +0 -2
                                             "****DS namepath not found"));
                         }
 
-                       /*
-                        * Initialize this package element. This function

handles the

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 192

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -1
-                        * resolution of named references within the

package.

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 9 lines
drivers/acpi/acpica/dspkginit.c +3 -6
-                        */
-                       acpi_ds_init_package_element(0,
-                                                    obj_desc->package.
-                                                    elements[i], NULL,
-                                                    &obj_desc->package.
-                                                    elements[i]);
+                       if (!module_level_code) {
+                               /*
+                                * Initialize this package element. This

function handles the

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 221

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+                                * resolution of named references within

the package.

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 222

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+                                * Forward references from module-level

code are deferred

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 4 lines
drivers/acpi/acpica/dspkginit.c +4 -0
+                                * until all ACPI tables are loaded.
+                                */
+                               acpi_ds_init_package_element(0,
+

obj_desc->package.

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 227

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+                                                            elements[i],

NULL,

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 228

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+

&obj_desc->package.

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct

Quoted 6 lines
drivers/acpi/acpica/dspkginit.c +2 -0
+                                                            elements[i]);
+                       }
                 }
 
                 if (*obj_desc_ptr) {
@@ -265,15 +297,21 @@ acpi_ds_build_internal_package_obj(struct

acpi_walk_state *walk_state,

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 8 lines
drivers/acpi/acpica/dspkginit.c +1 -3
                  * num_elements count.
                  *
                  * Note: this is not an error, the package is padded out
-                * with NULLs.
+                * with NULLs as per the ACPI specification.
                  */
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Package List length (%u) smaller than

NumElements "

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 272

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -1
-                                 "count (%u), padded with null

elements\n",

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 3 lines
drivers/acpi/acpica/dspkginit.c +2 -1
-                                 i, element_count));
+               ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO,
+                                     "%s: Package List length (%u)

smaller than NumElements "

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct · line 304

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +1 -0
+                                     "count (%u), padded with null

elements\n",

drivers/acpi/acpica/dspkginit.c acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,

Quoted 12 lines
drivers/acpi/acpica/dspkginit.c +8 -1
+                                     ACPI_GET_FUNCTION_NAME, i,
+                                     element_count));
+       }
+
+       /* Module-level packages will be resolved later */
+
+       if (!module_level_code) {
+               obj_desc->package.flags |= AOPOBJ_DATA_VALID;
         }
 
-       obj_desc->package.flags |= AOPOBJ_DATA_VALID;
         op->common.node = ACPI_CAST_PTR(struct acpi_namespace_node,

obj_desc);

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union

Quoted 3 lines
drivers/acpi/acpica/dspkginit.c +0 -0
         return_ACPI_STATUS(status);
  }
@@ -363,6 +401,10 @@ acpi_ds_resolve_package_element(union

acpi_operand_object **element_ptr)

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)

Quoted 5 lines
drivers/acpi/acpica/dspkginit.c +2 -0
         /* Check if reference element is already resolved */
 
         if (element->reference.resolved) {
+               ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+                                     "%s: Package element is already

resolved\n",

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union

Quoted 6 lines
drivers/acpi/acpica/dspkginit.c +2 -0
+                                     ACPI_GET_FUNCTION_NAME));
+
                 return_VOID;
         }
 
@@ -383,7 +425,10 @@ acpi_ds_resolve_package_element(union

acpi_operand_object **element_ptr)

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union · line 425

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -0
                                 "Could not find/resolve named package

element: %s",

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union

Quoted 10 lines
drivers/acpi/acpica/dspkginit.c +3 -0
                                 external_path));
 
+               /* Not found, set the element to NULL */
+
                 ACPI_FREE(external_path);
+               acpi_ut_remove_reference(*element_ptr);
                 *element_ptr = NULL;
                 return_VOID;
         } else if (resolved_node->type == ACPI_TYPE_ANY) {
@@ -397,23 +442,6 @@ acpi_ds_resolve_package_element(union

acpi_operand_object **element_ptr)

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)

Quoted 7 lines
drivers/acpi/acpica/dspkginit.c +0 -4
                 *element_ptr = NULL;
                 return_VOID;
         }
-#if 0
-       else if (resolved_node->flags & ANOBJ_TEMPORARY) {
-               /*
-                * A temporary node found here indicates that the

reference is

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union · line 404

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -1
-                * to a node that was created within this method. We are

not

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union · line 405

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -1
-                * going to allow it (especially if the package is

returned

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union · line 406

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -1
-                * from the method) -- the temporary node will be deleted

out

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)

Quoted 4 lines
drivers/acpi/acpica/dspkginit.c +0 -4
-                * from under the method. (05/2017).
-                */
-               ACPI_ERROR((AE_INFO,
-                           "Package element refers to a temporary name

[%4.4s], "

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)

Quoted 9 lines
drivers/acpi/acpica/dspkginit.c +0 -6
-                           "inserting a NULL element",
-                           resolved_node->name.ascii));
-               *element_ptr = NULL;
-               return_VOID;
-       }
-#endif
 
         /*
          * Special handling for Alias objects. We need resolved_node to

point

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union

Quoted 1 line
drivers/acpi/acpica/dspkginit.c +0 -0
@@ -449,20 +477,6 @@ acpi_ds_resolve_package_element(union

acpi_operand_object **element_ptr)

Quoted 4 lines
drivers/acpi/acpica/dspkginit.c +0 -1
         if (ACPI_FAILURE(status)) {
                 return_VOID;
         }
-#if 0

drivers/acpi/acpica/dspkginit.c acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)

Quoted 10 lines
drivers/acpi/acpica/dspkginit.c +0 -10
-/* TBD - alias support */
-       /*
-        * Special handling for Alias objects. We need to setup the type
-        * and the Op->Common.Node to point to the Alias target. Note,
-        * Alias has at most one level of indirection internally.
-        */
-       type = op->common.node->type;
-       if (type == ACPI_TYPE_LOCAL_ALIAS) {
-               type = obj_desc->common.type;
-               op->common.node = ACPI_CAST_PTR(struct

acpi_namespace_node,

drivers/acpi/acpica/dswexec.c acpi_status acpi_ds_exec_end_op(struct

Quoted 11 lines
drivers/acpi/acpica/dspkginit.c +0 -3
-                                               op->common.node->object);
-       }
-#endif
 
         switch (type) {
                 /*
drivers/acpi/acpica/dswexec.c +0 -0
index 2c07d220a50f..46962e34fc02 100644
@@ -576,8 +576,10 @@ acpi_status acpi_ds_exec_end_op(struct

acpi_walk_state *walk_state)

drivers/acpi/acpica/dswexec.c acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)

Quoted 4 lines
drivers/acpi/acpica/dswexec.c +0 -1
                 case AML_TYPE_CREATE_OBJECT:
 
                         ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
-                                         "Executing CreateObject

(Buffer/Package) Op=%p AMLPtr=%p\n",

drivers/acpi/acpica/dswexec.c acpi_status acpi_ds_exec_end_op(struct · line 579

Quoted 2 lines
drivers/acpi/acpica/dswexec.c +1 -1
-                                         op, op->named.data));
+                                         "Executing CreateObject

(Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",

drivers/acpi/acpica/nsparse.c acpi_ns_parse_table(u32 table_index, struct

Quoted 11 lines
drivers/acpi/acpica/dswexec.c +3 -0
+                                         op, op->named.value.arg,
+                                         op->common.parent->common.
+                                         aml_opcode));
 
                         switch (op->common.parent->common.aml_opcode) {
                         case AML_NAME_OP:
drivers/acpi/acpica/nsparse.c +0 -0
index 6ac2d26a2cfb..acb1aede720e 100644
@@ -267,8 +267,9 @@ acpi_ns_parse_table(u32 table_index, struct

acpi_namespace_node *start_node)

drivers/acpi/acpica/nsparse.c acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)

Quoted 7 lines
drivers/acpi/acpica/nsparse.c +2 -2
         ACPI_FUNCTION_TRACE(ns_parse_table);
 
         if (acpi_gbl_parse_table_as_term_list) {
-               ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
-                                 "**** Start table execution pass\n"));
+               ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
+                                     "%s: **** Start table execution

pass\n",

drivers/acpi/acpica/pstree.c union acpi_parse_object *acpi_ps_get_child(union

Quoted 9 lines
drivers/acpi/acpica/nsparse.c +1 -0
+                                     ACPI_GET_FUNCTION_NAME));
 
                 status = acpi_ns_execute_table(table_index, start_node);
                 if (ACPI_FAILURE(status)) {
drivers/acpi/acpica/pstree.c +0 -0
index f9fa88c79b32..a4dd08eca47c 100644
@@ -295,6 +295,7 @@ union acpi_parse_object *acpi_ps_get_child(union

acpi_parse_object *op)

include/acpi/acpixf.h ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt,

Quoted 11 lines
drivers/acpi/acpica/pstree.c +1 -0
         case AML_BUFFER_OP:
         case AML_PACKAGE_OP:
+       case AML_VARIABLE_PACKAGE_OP:
         case AML_METHOD_OP:
         case AML_IF_OP:
         case AML_WHILE_OP:
include/acpi/acpixf.h +0 -0
index c2bf1255f5aa..84c946882589 100644
@@ -192,15 +192,19 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt,

FALSE);

Quoted 27 lines
include/acpi/acpixf.h +6 -3
  /*
   * Optionally support group module level code.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
   */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, FALSE);
 
  /*
   * Optionally support module level code by parsing the entire table as
   * a term_list. Default is FALSE, do not execute entire table until some
   * lock order issues are fixed.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
   */
-ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, FALSE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, TRUE);
 
  /*
   * Optionally use 32-bit FADT addresses if and when there is a conflict
--

2.14.3

--
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

A message that is not in the archive (sent off-list or not yet received): CAA9_cmftDhE4dbEAPSXhW2DY2j_toWmsU2E-NJ6cG3Vd0MdXVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 62 lines · Dan Williams

[ adding linux-nvdimm ]

Quoted 50 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Quoted 6 lines

Hi,

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

With the following set of clean reverts on top of latest-Linus I'm back to a working configuration:

Revert "ACPICA: Change a compile-time option to a runtime option" Revert "ACPICA: Cleanup/simplify module-level code support" Revert "ACPICA: Rename a global for clarity, no functional change" Revert "ACPICA: Add option to disable Package object name resolution errors" Revert "ACPICA: Integrate package handling with module-level code"

...i.e.

git revert 34f206fd757c
git revert a406dea82af8
git revert e7d970f6fca8
git revert 959c38a7e128
git revert 5a8361f7ecce

A message that is not in the archive (sent off-list or not yet received): CAPcyv4hp_pm2n3H_froFkedd_GMQvsrEc8yZxYzfYkPDYvjDww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#9 lore raw

RE: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 12 lines

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Thursday, April 12, 2018 5:57 PM
To: Schmauss, Erik <[email protected]>
Cc: Linux ACPI <[email protected]>; Rafael J. Wysocki <[email protected]>; Moore, Robert <[email protected]>; linux-nvdimm <[email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-
level code

Quoted 72 lines
Quoted 69 lines · Dan Williams

[ adding linux-nvdimm ]

Quoted 50 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Hi,

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

Hi Dan,

Thanks for figuring this out. Do you think it's possible for you to send me a full acpidump or some sort hexdump of the QEMU environment?

Quoted 9 lines

With the following set of clean reverts on top of latest-Linus I'm back to a working configuration:

Revert "ACPICA: Change a compile-time option to a runtime option" Revert "ACPICA: Cleanup/simplify module-level code support" Revert "ACPICA: Rename a global for clarity, no functional change" Revert "ACPICA: Add option to disable Package object name resolution errors" Revert "ACPICA: Integrate package handling with module-level code"

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream. If this is the case, I wonder if we could change the ACPICA version number so that it is one digit lower or append something to the end of the version number. This would be helpful in reminding us that it's not the full release in ACPICA upstream. Either that or remove the ACPICA release all together for this rc..

Thanks,

Erik

Quoted 7 lines

...i.e.

git revert 34f206fd757c
git revert a406dea82af8
git revert e7d970f6fca8
git revert 959c38a7e128
git revert 5a8361f7ecce

A message that is not in the archive (sent off-list or not yet received): CF6A88132359CE47947DB4C6E1709ED5397230D6-8oqHQFITsIHTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org

#11 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 97 lines · Erik
Quoted 11 lines

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Thursday, April 12, 2018 5:57 PM
To: Schmauss, Erik <[email protected]>
Cc: Linux ACPI <[email protected]>; Rafael J. Wysocki <[email protected]>; Moore, Robert <[email protected]>; linux-nvdimm <[email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module- level code

Quoted 72 lines
Quoted 69 lines · Dan Williams

[ adding linux-nvdimm ]

Quoted 50 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Hi,

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

Hi Dan,

Thanks for figuring this out. Do you think it's possible for you to send me a full acpidump or some sort hexdump of the QEMU environment?

Quoted 9 lines

With the following set of clean reverts on top of latest-Linus I'm back to a working configuration:

Revert "ACPICA: Change a compile-time option to a runtime option" Revert "ACPICA: Cleanup/simplify module-level code support" Revert "ACPICA: Rename a global for clarity, no functional change" Revert "ACPICA: Add option to disable Package object name resolution errors" Revert "ACPICA: Integrate package handling with module-level code"

Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

Quoted 5 lines

If this is the case, I wonder if we could change the
ACPICA version number so that it is one digit lower or append something to the end of the version number. This would be helpful in reminding us that it's not the full release in ACPICA upstream. Either that or remove the ACPICA release all together for this rc..

I can revert the commit updating the ACPICA version number easily enough. :-)

Quoted 8 lines
Quoted 7 lines

...i.e.

git revert 34f206fd757c
git revert a406dea82af8
git revert e7d970f6fca8
git revert 959c38a7e128
git revert 5a8361f7ecce

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 98 lines · Rafael J. Wysocki
Quoted 97 lines · Erik
Quoted 11 lines

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Thursday, April 12, 2018 5:57 PM
To: Schmauss, Erik <[email protected]>
Cc: Linux ACPI <[email protected]>; Rafael J. Wysocki <[email protected]>; Moore, Robert <[email protected]>; linux-nvdimm <[email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-
level code

Quoted 72 lines
Quoted 69 lines · Dan Williams

[ adding linux-nvdimm ]

Quoted 50 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the scope of DEV1. Since DEV1 is not in scope, this would incur an AE_NOT_FOUND error. After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Hi,

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

Hi Dan,

Thanks for figuring this out. Do you think it's possible for you to send me a full acpidump or some sort hexdump of the QEMU environment?

Quoted 9 lines

With the following set of clean reverts on top of latest-Linus I'm back to a working configuration:

Revert "ACPICA: Change a compile-time option to a runtime option" Revert "ACPICA: Cleanup/simplify module-level code support" Revert "ACPICA: Rename a global for clarity, no functional change" Revert "ACPICA: Add option to disable Package object name resolution errors" Revert "ACPICA: Integrate package handling with module-level code"

Quoted 7 lines
Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

Note, that I'm willing to try any proposed fix patches on top. I just wanted to clarify that we have a simple fallback position if the debug starts dragging out.

A message that is not in the archive (sent off-list or not yet received): CAPcyv4j-iC+b07=JPP_TV1MLHA2iO5iKLvc+jaPHoEuRfzoAFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw

RE: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

[ trimming ]

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

Hi Rafael,

Quoted 2 lines
Quoted 2 lines

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

This is indeed what I meant last week. However, I've looked into the issue and Dan's qemu
instance had AML that we no longer support. This is because the ACPICA commit makes changes to the execution of AML during table load to match windows AML interpreter behavior so this commit also got rid of support for executing code containing forward references (except for package elements).

I've suggested a fix for the firmware in a separate email. So I would say that this issue is resolved after if Dan can run his test successfully with the adjusted firmware.

If Dan's test is successful, we don’t need to revert these changes

Erik

Quoted 3 lines

Note, that I'm willing to try any proposed fix patches on top. I just wanted to clarify that we have a simple fallback position if the debug starts dragging out.

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): CF6A88132359CE47947DB4C6E1709ED539727606-8oqHQFITsIHTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org

#17 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 16 lines · Erik

[ trimming ]

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

Hi Rafael,

Quoted 2 lines
Quoted 2 lines

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

This is indeed what I meant last week. However, I've looked into the issue and Dan's qemu
instance had AML that we no longer support. This is because the ACPICA commit makes changes to the execution of AML during table load to match windows AML interpreter behavior so this commit also got rid of support for executing code containing forward references (except for package elements).

Quoted 4 lines

I've suggested a fix for the firmware in a separate email. So I would say that this issue is resolved after if Dan can run his test successfully with the adjusted firmware.

If Dan's test is successful, we don’t need to revert these changes

I'm concerned about other qemu-kvm users that do not upgrade their hypervisor at the same pace as their guest kernel. Especially for cloud providers that may be running latest mainline kernel on older qemu-kvm this will look like a pure kernel regression. Is there a quick fix we can carry in the kernel to support these forward references, at least until we know that qemu-kvm is no longer shipping the broken AML?
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): CAPcyv4jEkQTEWxE=+mf0C5oA0j50ZvjU=QpvL1n6mmtemrnBLg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#19 lore raw

RE: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Dan Williams
Sent: Monday, April 16, 2018 4:22 PM
To: Schmauss, Erik <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>; Linux ACPI <linux- [email protected]>; Moore, Robert <[email protected]>; linux- nvdimm <[email protected]>; Qemu Developers <qemu- [email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module- level code

Quoted 8 lines · Erik

[ trimming ]

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

Hi Rafael,

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

This is indeed what I meant last week. However, I've looked into the issue and Dan's qemu instance had AML that we no longer support. This is because the ACPICA commit makes changes to the execution of AML during table load to match windows AML interpreter behavior so this commit

Quoted 9 lines

also got rid of support for executing code containing forward references (except for package elements).

Quoted 3 lines

I've suggested a fix for the firmware in a separate email. So I would say that this issue is resolved after if Dan can run his test successfully with the

adjusted firmware.

Quoted 2 lines

If Dan's test is successful, we don’t need to revert these changes

Hi Dan,

Quoted 6 lines

I'm concerned about other qemu-kvm users that do not upgrade their hypervisor at the same pace as their guest kernel. Especially for cloud providers that may be running latest mainline kernel on older qemu-kvm this will look like a pure kernel regression. Is there a quick fix we can carry in the kernel to support these forward references, at least until we know that qemu-kvm is no longer shipping the broken AML?

This is a very good point. Thanks for bringing this up! One option is for them to set the global variable acpi_gbl_execute_tables_as_methods in include/acpi/acpixf.h to false. This will effectively revert the new behavior in the AML interpreter and go back to the old way. Since this is a global flag, we could have a command line option for Linux kernel to turn this feature on.

Out of curiosity, is this ACPI table somehow customized for your work? I have a collection of acpi tables and your ACPI tables are the only ones that have an OperationRegion called NRAM. What is the chance that others will be running Linux on the same tables as the one you sent me?

Erik

Quoted 4 lines

--
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

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): CF6A88132359CE47947DB4C6E1709ED53972762F-8oqHQFITsIHTXloPLtfHfbfspsVTdybXVpNB7YpNyf8@public.gmane.org

#21 lore raw

Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

Quoted 55 lines · Erik
Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Dan Williams
Sent: Monday, April 16, 2018 4:22 PM
To: Schmauss, Erik <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>; Linux ACPI <linux- [email protected]>; Moore, Robert <[email protected]>; linux- nvdimm <[email protected]>; Qemu Developers <qemu- [email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with module- level code

Quoted 8 lines · Erik

[ trimming ]

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

Hi Rafael,

Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

This is indeed what I meant last week. However, I've looked into the issue and Dan's qemu instance had AML that we no longer support. This is because the ACPICA commit makes changes to the execution of AML during table load to match windows AML interpreter behavior so this commit

Quoted 9 lines

also got rid of support for executing code containing forward references (except for package elements).

Quoted 3 lines

I've suggested a fix for the firmware in a separate email. So I would say that this issue is resolved after if Dan can run his test successfully with the

adjusted firmware.

Quoted 2 lines

If Dan's test is successful, we don’t need to revert these changes

Hi Dan,

Quoted 6 lines

I'm concerned about other qemu-kvm users that do not upgrade their hypervisor at the same pace as their guest kernel. Especially for cloud providers that may be running latest mainline kernel on older qemu-kvm this will look like a pure kernel regression. Is there a quick fix we can carry in the kernel to support these forward references, at least until we know that qemu-kvm is no longer shipping the broken AML?

This is a very good point. Thanks for bringing this up! One option is for them to set the global variable acpi_gbl_execute_tables_as_methods in include/acpi/acpixf.h to false. This will effectively revert the new behavior in the AML interpreter and go back to the old way. Since this is a global flag, we could have a command line option for Linux kernel to turn this feature on.

Quoted 4 lines

Out of curiosity, is this ACPI table somehow customized for your work? I have a collection of acpi tables and your ACPI tables are the only ones that have an OperationRegion called NRAM. What is the chance that others will be running Linux on the same tables as the one you sent me?

I don't think there's anything atypical about my particular setup. It creates two virtual NVDIMMs that each represent a 30GB address space. I suspect any user of the KVM NVDIMM virtualization would see the same problem.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

#22 lore raw

RE: [PATCH v2 5/7] ACPICA: Integrate package handling with module-level code

In reply to a message not in the archive
Quoted 121 lines

-----Original Message-----
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Friday, April 13, 2018 12:43 AM
To: Schmauss, Erik <[email protected]>
Cc: Williams, Dan J <[email protected]>; Linux ACPI <linux- [email protected]>; Moore, Robert <[email protected]>; linux- nvdimm <[email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with
module-level code

Quoted 49 lines · Erik
Quoted 49 lines

-----Original Message-----
From: Dan Williams [mailto:[email protected]]
Sent: Thursday, April 12, 2018 5:57 PM
To: Schmauss, Erik <[email protected]>
Cc: Linux ACPI <[email protected]>; Rafael J. Wysocki <[email protected]>; Moore, Robert <[email protected]>; linux-nvdimm <[email protected]>
Subject: Re: [PATCH v2 5/7] ACPICA: Integrate package handling with
module- level code

Quoted 35 lines · Dan Williams

[ adding linux-nvdimm ]

Quoted 28 lines · Erik Schmauss

ACPICA commit 8faf6fca445eb7219963d80543fb802302a7a8c7

This change completes the integration of the recent changes to package object handling with the module-level code support.

For acpi_exec, the -ep flag is removed.

This change allows table load to behave as if it were a method invocation. Before this, the definition block definition below would have loaded all named objects at the root scope. After loading, it would execute the if statements at the root scope.

DefinitionBlock (...)

{
   Name(OBJ1, 0)

   if (1)
   {
     Device (DEV1)
     {
       Name (_HID,0x0)
     }
   }
   Scope (DEV1)
   {
     Name (OBJ2)
   }
}
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The above code would load OBJ1 to the namespace, defer the execution of the if statement and attempt to add OBJ2 within the

scope of DEV1.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Since DEV1 is not in scope, this would incur an AE_NOT_FOUND

error.

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 18 lines

After this error is emitted, the if block is invoked and DEV1 and its _HID is added to the namespace.

This commit changes the behavior to execute the if block in place rather than deferring it until all tables are loaded. The new behavior is as follows: insert OBJ1 in the namespace, invoke the if statement and add DEV1 and its _HID to the namespace, add OBJ2 to the scope of DEV1.

Bug report links:

Quoted 6 lines

ACPICA repo:

Hi,

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

This commit 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") regresses the detection of persistent memory in my qemu-kvm setup.

Hi Dan,

Thanks for figuring this out. Do you think it's possible for you to

send me a full acpidump or some sort hexdump of the QEMU environment?

Quoted 8 lines
Quoted 8 lines

With the following set of clean reverts on top of latest-Linus I'm back to a working configuration:

Revert "ACPICA: Change a compile-time option to a runtime option" Revert "ACPICA: Cleanup/simplify module-level code support" Revert "ACPICA: Rename a global for clarity, no functional change" Revert "ACPICA: Add option to disable Package object name

resolution errors"

Quoted 7 lines
Quoted 2 lines

Revert "ACPICA: Integrate package handling with module-level code"

Rafael, we may want to hold back on the module-level code changes (the patches below) for rc1. Between this and the strange _TSS issue, it seems like there are a few more things to resolve before this is ready for kernel upstream.

It looks like you are asking me to queue up reverts as per the Dan's report, is that correct?

Quoted 8 lines
Quoted 5 lines

If this is the case, I wonder if we could change the ACPICA version number so that it is one digit lower or append something to the end of the version number. This would be helpful in reminding us that it's not the full release in ACPICA upstream. Either that or remove the ACPICA release all together for this rc..

I can revert the commit updating the ACPICA version number easily enough. :-)

[Moore, Robert]

We should be able to figure this one out soon. Need acpidump Bob

Quoted 10 lines
Quoted 9 lines
Quoted 8 lines

...i.e.

git revert 34f206fd757c
git revert a406dea82af8
git revert e7d970f6fca8
git revert 959c38a7e128
git revert 5a8361f7ecce

#23 lore raw

PATCH v2 6/7 ACPICA: Add option to disable Package object name resolution errors

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit a6c3c725c44dd44ad9d3f2b2a64351fdbe6e0014

For the kernel-resident ACPICA, optionally be silent about the NOT_FOUND case. Although this is potentially a serious problem, it can generate a lot of noise/errors on platforms whose firmware carries around a bunch of unused Package objects. To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS in the OS-specific header.

---
 drivers/acpi/acpica/dspkginit.c | 38 +++++++++++++++++++++++++++++++-------
 include/acpi/platform/aclinux.h |  1 +
 2 files changed, 32 insertions(+), 7 deletions(-)
drivers/acpi/acpica/dspkginit.c +31 -7
index a307a07aeacd..7d48525b5e52 100644
@@ -389,11 +389,12 @@ static void
 acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 {
 	acpi_status status;
+	acpi_status status2;
 	union acpi_generic_state scope_info;
 	union acpi_operand_object *element = *element_ptr;
 	struct acpi_namespace_node *resolved_node;
 	struct acpi_namespace_node *original_node;
-	char *external_path = NULL;
+	char *external_path = "";
 	acpi_object_type type;
 
 	ACPI_FUNCTION_TRACE(ds_resolve_package_element);
@@ -417,17 +418,40 @@ acpi_ds_resolve_package_element(union acpi_operand_object **element_ptr)
 				ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
 				NULL, &resolved_node);
 	if (ACPI_FAILURE(status)) {
-		status = acpi_ns_externalize_name(ACPI_UINT32_MAX,
-						  (char *)element->reference.
-						  aml, NULL, &external_path);
+#if defined ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS && !defined ACPI_APPLICATION
+		/*
+		 * For the kernel-resident ACPICA, optionally be silent about the
+		 * NOT_FOUND case. Although this is potentially a serious problem,
+		 * it can generate a lot of noise/errors on platforms whose
+		 * firmware carries around a bunch of unused Package objects.
+		 * To disable these errors, define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS
+		 * in the OS-specific header.
+		 *
+		 * All errors are always reported for ACPICA applications such as
+		 * acpi_exec.
+		 */
+		if (status == AE_NOT_FOUND) {
+
+			/* Reference name not found, set the element to NULL */
+
+			acpi_ut_remove_reference(*element_ptr);
+			*element_ptr = NULL;
+			return_VOID;
+		}
+#endif
+		status2 = acpi_ns_externalize_name(ACPI_UINT32_MAX,
+						   (char *)element->reference.
+						   aml, NULL, &external_path);
 
 		ACPI_EXCEPTION((AE_INFO, status,
-				"Could not find/resolve named package element: %s",
+				"While resolving a named reference package element - %s",
 				external_path));
+		if (ACPI_SUCCESS(status2)) {
+			ACPI_FREE(external_path);
+		}
 
-		/* Not found, set the element to NULL */
+		/* Could not resolve name, set the element to NULL */
 
-		ACPI_FREE(external_path);
 		acpi_ut_remove_reference(*element_ptr);
 		*element_ptr = NULL;
 		return_VOID;
include/acpi/platform/aclinux.h +1 -0
index adee92c38c43..e6e757254138 100644
@@ -58,6 +58,7 @@
 
 #define ACPI_USE_SYSTEM_CLIBRARY
 #define ACPI_USE_DO_WHILE_0
+#define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS
 
 #ifdef __KERNEL__
 
Signature · 1 line
2.14.3
#24 lore raw

PATCH v2 7/7 ACPICA: Update version to 20180209

In reply to Erik Schmauss

From: Bob Moore <[email protected]>

ACPICA commit 6e3468837f9f32f64c7d0a6e20bf0d2579411d43

Version 20180209.

---
 include/acpi/acpixf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 84c946882589..ecd22e45ce3b 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20180105
+#define ACPI_CA_VERSION                 0x20180209
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
2.14.3
#25 lore raw
In reply to Erik Schmauss
Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:linux-acpi- [email protected]] On Behalf Of Erik Schmauss
Sent: Thursday, February 15, 2018 1:09 PM
To: [email protected]
Cc: [email protected]; Schmauss, Erik <[email protected]>
Subject: [PATCH v2 0/7] ACPICA release 20180208v2

v2 of the patch set. Apparently, a patch was left off due to issues with my mail client...

This is the ACPICA20180212 release.

Notable commits are changes made to integrate package handling with MLC and setting the TermList parsing as a default. A small commit was made to disable package resolution errors. This reverts the error reporting behavior to match the previous behavior (in 4.13)

Bob Moore (5):
ACPICA: Update error message, no functional change
ACPICA: Update for some debug output. No functional change
ACPICA: Revert "Fix for implicit result conversion for the ToXXXX
functions"
ACPICA: Add option to disable Package object name resolution errors
ACPICA: Update version to 20180209

Quoted 2 lines

Erik Schmauss (2):
ACPICA: Restructure ACPI table files

This probably did not send to the mailing list due to its size.
This commit is available here: https://github.com/SchmErik/linux/commit/58f4a9a56fe0789c1c9cd2c48ae45225f85dabdf

Quoted 35 lines

ACPICA: Integrate package handling with module-level code

 drivers/acpi/acpica/acopcode.h  |   14 +-
 drivers/acpi/acpica/amlcode.h   |   20 +-
 drivers/acpi/acpica/dsargs.c    |    1 +
 drivers/acpi/acpica/dsopcode.c  |    4 +-
 drivers/acpi/acpica/dspkginit.c |  164 ++--
 drivers/acpi/acpica/dswexec.c   |    6 +-
 drivers/acpi/acpica/dswload.c   |    2 +-
 drivers/acpi/acpica/exconvrt.c  |    1 +
 drivers/acpi/acpica/exnames.c   |    7 +-
 drivers/acpi/acpica/exresop.c   |    1 +
 drivers/acpi/acpica/nseval.c    |    8 +-
 drivers/acpi/acpica/nsinit.c    |    7 +-
 drivers/acpi/acpica/nsnames.c   |    3 +
 drivers/acpi/acpica/nsparse.c   |   10 +-
 drivers/acpi/acpica/psloop.c    |    4 +-
 drivers/acpi/acpica/psparse.c   |    2 +-
 drivers/acpi/acpica/pstree.c    |    1 +
 drivers/acpi/acpica/utcache.c   |    7 +-
 drivers/acpi/acpica/utdelete.c  |   20 +-
 include/acpi/acpixf.h           |   10 +-
 include/acpi/actbl1.h           | 1638 ++++++++++++++++----------------
 include/acpi/actbl2.h           | 1964 +++++++++++++++++++++------------------
 include/acpi/actbl3.h           | 1016 +++++++++-----------
 include/acpi/platform/aclinux.h |    1 +
 24 files changed, 2477 insertions(+), 2434 deletions(-)

--
2.14.3

--
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