Skip to contentSkip to conversation

ACPICA: 20160930 Release

PATCH In review Lv Zheng 2 participants 9 messages Oct 17, 2016 – Nov 14, 2016

Subsystems (2)
lore
Share & tools
lore

Lv Zheng

author
#0 lore raw

cover ACPICA: 20160930 Release

The 20160930 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "Microsoft Surface Pro 3"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20160831 Release):
508 lines
After applying (20160930 Release):
508 lines

Bob Moore (5):
ACPICA: Update an info message during table load phase.
ACPICA: Increase loop limit for AE_AML_INFINITE_LOOP exception
ACPICA: Disassembler: Fix for Divide() support, new support for test
suite
ACPICA: Move acpi_gbl_max_loop_iterations to the public globals file
ACPICA: Update version to 20160930

Lv Zheng (2):
ACPICA: MacOSX: Fix anonymous semaphore implementation
ACPICA: MacOSX: Fix wrong sem_destroy definition

 drivers/acpi/acpica/acglobal.h                        |  5 +----
 drivers/acpi/acpica/aclocal.h                         | 19 ++++++++++---------
 drivers/acpi/acpica/tbxfload.c                        |  6 +++++-
 include/acpi/acconfig.h                               |  2 +-
 include/acpi/acpixf.h                                 |  9 ++++++++-
 .../power/acpi/os_specific/service_layers/osunixxf.c  | 13 +++++++++++--
 6 files changed, 36 insertions(+), 18 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/7 ACPICA: Update an info message during table load phase.

From: Bob Moore <[email protected]>

ACPICA commit 1d435008fd9ea34768df8862de9cb6fff69650f6

Only emit an extra newline for acpiexec.

---
 drivers/acpi/acpica/tbxfload.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/acpica/tbxfload.c +5 -1
index 5569f63..2599e831 100644
@@ -239,7 +239,7 @@ acpi_status acpi_tb_load_namespace(void)
 	}
 
 	if (!tables_failed) {
-		ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded\n", tables_loaded));
+		ACPI_INFO(("%u ACPI AML tables successfully acquired and loaded", tables_loaded));
 	} else {
 		ACPI_ERROR((AE_INFO,
 			    "%u table load failures, %u successful",
@@ -250,6 +250,10 @@ acpi_status acpi_tb_load_namespace(void)
 		status = AE_CTRL_TERMINATE;
 	}
 
+#ifdef ACPI_APPLICATION
+	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, "\n"));
+#endif
+
 unlock_and_exit:
 	(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
 	return_ACPI_STATUS(status);
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/7 ACPICA: MacOSX: Fix anonymous semaphore implementation

In reply to Lv Zheng

ACPICA commit 01eb9a58f4cf6300a0feb838a02bc4b1895c76e8 ACPICA commit de5b9c0ef1ccb264cbe57c88f6dd3fbf8229f907

The following build errors can be seen for MacOSX builds:
.../osunixxf.c:829:42: error: 'tmpnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Werror,-Wdeprecated-declarations]

Using of temporal file name functions can easily result in bus errors on MacOSX. This patch implements anonymous semaphore using an automatic increasing number. Lv Zheng.

Linux is not affected by this change.

---
 tools/power/acpi/os_specific/service_layers/osunixxf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/power/acpi/os_specific/service_layers/osunixxf.c +5 -1
index 8d8003c..8f5ded8 100644
@@ -646,8 +646,12 @@ acpi_os_create_semaphore(u32 max_units,
 	}
 #ifdef __APPLE__
 	{
-		char *semaphore_name = tmpnam(NULL);
+		static int semaphore_count = 0;
+		char semaphore_name[32];
 
+		snprintf(semaphore_name, sizeof(semaphore_name), "acpi_sem_%d",
+			 semaphore_count++);
+		printf("%s\n", semaphore_name);
 		sem =
 		    sem_open(semaphore_name, O_EXCL | O_CREAT, 0755,
 			     initial_units);
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/7 ACPICA: MacOSX: Fix wrong sem_destroy definition

In reply to Lv Zheng

ACPICA commit bbcb58f7875381d5c7f3d614bad3bc628a3f5cc6

The following build errors can be seen for MacOSX builds:
.../osunixxf.c:882:9: error: 'sem_close' is deprecated [-Werror,-Wdeprecated-declarations] .../acmacosx.h:122:29: note: expanded from macro 'sem_destroy'
#define sem_destroy sem_close

sem_destroy() issue is caused by the wrong order of the following lines:
#define #sem_destroy sem_close
#include <semaphore.h>
This patch fixes it by removing the buggy re-definitiion. Lv Zheng.

Linux is not affected by this change.

---
 tools/power/acpi/os_specific/service_layers/osunixxf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/power/acpi/os_specific/service_layers/osunixxf.c +6 -1
index 8f5ded8..10648aa 100644
@@ -696,10 +696,15 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
 	if (!sem) {
 		return (AE_BAD_PARAMETER);
 	}
-
+#ifdef __APPLE__
+	if (sem_close(sem) == -1) {
+		return (AE_BAD_PARAMETER);
+	}
+#else
 	if (sem_destroy(sem) == -1) {
 		return (AE_BAD_PARAMETER);
 	}
+#endif
 
 	return (AE_OK);
 }
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/7 ACPICA: Increase loop limit for AE_AML_INFINITE_LOOP exception

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 9f83b34cb172549c20f18663bc7460fb4145a75b

increase loop limit to accomodate faster processors. From 64k loops max to 1 million.

---
 drivers/acpi/acpica/acglobal.h | 2 +-
 include/acpi/acconfig.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -1
index 750fa82..17f7bb8 100644
@@ -242,7 +242,7 @@ ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);
 
 /* Maximum number of While() loop iterations before forced abort */
 
-ACPI_GLOBAL(u16, acpi_gbl_max_loop_iterations);
+ACPI_GLOBAL(u32, acpi_gbl_max_loop_iterations);
 
 /* Control method single step flag */
 
include/acpi/acconfig.h +1 -1
index 12c2882..d25da93 100644
@@ -146,7 +146,7 @@
 
 /* Maximum number of While() loops before abort */
 
-#define ACPI_MAX_LOOP_COUNT             0xFFFF
+#define ACPI_MAX_LOOP_COUNT             0x000FFFFF
 
 /******************************************************************************
  *
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/7 ACPICA: Disassembler: Fix for Divide() support, new support for test suite

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit 4b367408659af08fd44839866ec301285284e6f4

Fixes a problem with complex expressions where an illegal mix of legacy ASL and ASL+ could be emitted.

Adds new support for ASLTS that disables some disassembler optimizations could be changed during a conversion to ASL+. These expressions are now emitted in legacy ASL instead of ASL+.

---
 drivers/acpi/acpica/acglobal.h |  1 +
 drivers/acpi/acpica/aclocal.h  | 19 ++++++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)
drivers/acpi/acpica/acglobal.h +1 -0
index 17f7bb8..b549e6d 100644
@@ -318,6 +318,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_emit_external_opcodes, FALSE);
+ACPI_INIT_GLOBAL(u8, acpi_gbl_do_disassembler_optimizations, TRUE);
 
 ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm);
 ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing);
drivers/acpi/acpica/aclocal.h +10 -9
index dff1207..7926600 100644
@@ -765,7 +765,7 @@ union acpi_parse_value {
 	union acpi_parse_value          value;          /* Value or args associated with the opcode */\
 	u8                              arg_list_length; /* Number of elements in the arg list */\
 	ACPI_DISASM_ONLY_MEMBERS (\
-	u8                              disasm_flags;   /* Used during AML disassembly */\
+	u16                             disasm_flags;   /* Used during AML disassembly */\
 	u8                              disasm_opcode;  /* Subtype used for disassembly */\
 	char                            *operator_symbol;/* Used for C-style operator name strings */\
 	char                            aml_op_name[16])	/* Op name (debug only) */
@@ -868,14 +868,15 @@ struct acpi_parse_state {
 
 /* Parse object disasm_flags */
 
-#define ACPI_PARSEOP_IGNORE                 0x01
-#define ACPI_PARSEOP_PARAMETER_LIST         0x02
-#define ACPI_PARSEOP_EMPTY_TERMLIST         0x04
-#define ACPI_PARSEOP_PREDEFINED_CHECKED     0x08
-#define ACPI_PARSEOP_CLOSING_PAREN          0x10
-#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT    0x20
-#define ACPI_PARSEOP_ASSIGNMENT             0x40
-#define ACPI_PARSEOP_ELSEIF                 0x80
+#define ACPI_PARSEOP_IGNORE                 0x0001
+#define ACPI_PARSEOP_PARAMETER_LIST         0x0002
+#define ACPI_PARSEOP_EMPTY_TERMLIST         0x0004
+#define ACPI_PARSEOP_PREDEFINED_CHECKED     0x0008
+#define ACPI_PARSEOP_CLOSING_PAREN          0x0010
+#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT    0x0020
+#define ACPI_PARSEOP_ASSIGNMENT             0x0040
+#define ACPI_PARSEOP_ELSEIF                 0x0080
+#define ACPI_PARSEOP_LEGACY_ASL_ONLY        0x0100
 
 /*****************************************************************************
  *
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 6/7 ACPICA: Move acpi_gbl_max_loop_iterations to the public globals file

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit eb8b2194200867dec9ba38e5ab98b5b8ef262945

Moved to acpixf.h with the rest of the configuration globals.

---
 drivers/acpi/acpica/acglobal.h | 4 ----
 include/acpi/acpixf.h          | 7 +++++++
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/acpica/acglobal.h +0 -4
index b549e6d..edbb42e 100644
@@ -240,10 +240,6 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);
 
 ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);
 
-/* Maximum number of While() loop iterations before forced abort */
-
-ACPI_GLOBAL(u32, acpi_gbl_max_loop_iterations);
-
 /* Control method single step flag */
 
 ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);
include/acpi/acpixf.h +7 -0
index c7b3a13..07ab21e 100644
@@ -259,6 +259,13 @@ 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.
+ * 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);
+
+/*
  * This mechanism is used to trace a specified AML method. The method is
  * traced each time it is executed.
  */
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 7/7 ACPICA: Update version to 20160930

In reply to Lv Zheng

From: Bob Moore <[email protected]>

ACPICA commit cb8dfc8157ae54aadb1beb31d996db9327438183

Version 20160930.

---
 include/acpi/acpixf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/acpixf.h +1 -1
index 07ab21e..5c7356a 100644
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20160831
+#define ACPI_CA_VERSION                 0x20160930
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
Signature · 1 line
2.7.4
#8 lore raw
In reply to Lv Zheng
Quoted 46 lines · Lv Zheng

The 20160930 ACPICA kernel-resident subsystem updates are linuxized based on the linux-pm/linux-next branch.

The patchset has passed the following build/boot tests. Build tests are performed as follows:
1. i386 + allyes
2. i386 + allno
3. i386 + default + ACPI_DEBUGGER=y
4. i386 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y
5. i386 + default + ACPI_DEBUG=n + ACPI=y
6. i386 + default + ACPI=n
7. x86_64 + allyes
8. x86_64 + allno
9. x86_64 + default + ACPI_DEBUGGER=y
10.x86_64 + default + ACPI_DEBUGGER=n + ACPI_DEBUG=y 11.x86_64 + default + ACPI_DEBUG=n + ACPI=y
12.x86_64 + default + ACPI=n
Boot tests are performed as follows:
1. x86_64 + default + ACPI_DEBUGGER=y
Where:
1. i386: machine named as "Dell Inspiron Mini 1010"
2. x86_64: machine named as "Microsoft Surface Pro 3"
3. default: kernel configuration with following items enabled:
All hardware drivers related to the machines of i386/x86_64 All "drivers/acpi" configurations
All "drivers/platform" drivers
All other drivers that link the APIs provided by ACPICA subsystem

The divergences checking result:
Before applying (20160831 Release):
508 lines
After applying (20160930 Release):
508 lines

Bob Moore (5):
ACPICA: Update an info message during table load phase.
ACPICA: Increase loop limit for AE_AML_INFINITE_LOOP exception
ACPICA: Disassembler: Fix for Divide() support, new support for test
suite
ACPICA: Move acpi_gbl_max_loop_iterations to the public globals file
ACPICA: Update version to 20160930

Lv Zheng (2):
ACPICA: MacOSX: Fix anonymous semaphore implementation
ACPICA: MacOSX: Fix wrong sem_destroy definition

Quoted 7 lines
 drivers/acpi/acpica/acglobal.h                        |  5 +----
 drivers/acpi/acpica/aclocal.h                         | 19 ++++++++++---------
 drivers/acpi/acpica/tbxfload.c                        |  6 +++++-
 include/acpi/acconfig.h                               |  2 +-
 include/acpi/acpixf.h                                 |  9 ++++++++-
 .../power/acpi/os_specific/service_layers/osunixxf.c  | 13 +++++++++++--
 6 files changed, 36 insertions(+), 18 deletions(-)

Whole series applied.

Thanks,
Rafael