All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lv Zheng <lv.zheng@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>,
	Andy Lutomirski <luto@kernel.org>
Cc: Lv Zheng <lv.zheng@intel.com>, Lv Zheng <zetalog@gmail.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [PATCH v4 0/7] ACPICA / debugger: Add in-kernel AML debugger support
Date: Thu,  3 Dec 2015 10:40:00 +0800	[thread overview]
Message-ID: <cover.1449108825.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1446790780.git.lv.zheng@intel.com>

This patchset enables ACPICA debugger for Linux kernel and implements a
userspace utility to access it.

A. Build the AML debugger
In order to build the kernel support of AML debugger, the following kconfig
items should be enabled:
 CONFIG_ACPI_DEBUG=y
 CONFIG_ACPI_DEBUGGER=y
 CONFIG_DEBUG_FS=y
 CONFIG_ACPI_DEBUGGER_USER=m
The userspace tool can be found at tools/power/acpi/tools/acpidbg. To
build this utility, staying in tools folder and type "make acpi".

B. Load the AML debugger during runtime
In order to use the in-kernel AML debugger, the following command should be
executed using root user:
 # modprobe acpi_dbg
 # mount -t debugfs none /sys/kernel/debug
 # acpidbg

C. Batch mode
In order to support scripts, the userspace utility also supports single
command batch mode:
 # acpidbg -b "help"
 # acpidbg -b "tables"
 # acpidbg -b "find _LID"
 # acpidbg -b "execute \_SB.LID0._LID"
You can find the documentation about the ACPICA debugger commands in:
 https://acpica.org/sites/acpica/files/acpica-reference_17.pdf
 (The latest document can be found at https://acpica.org/documentation)
And refer to the chapter - ACPICA debugger reference to obtain the full
description of the debugger commands. Note that not all commands are
supported by an in-kernel AML debugger.

D. Unload the AML debugger during runtime
After terminating all acpidbg instances, the following command can be
executed to remove the AML debugger from kernel:
 # rmmod acpi_dbg

The following tasks are not completed:
1. .flush() support in the kernel debugger IO driver.
2. multi-commands batch mode.

v2:
1. Fix a help message issue for the userspace acpidbg utility (this is a
   typo fix).
2. Fix a batch mode issue by adding "\n" to the prompt sequence (this was
   lost due to too many rebase cycles).
3. Fix kconfig dependency for an intermediate patch (this is only useful in
   case the latter patches are reverted).
4. Add more accurate runtime debugger stub mechanism and remove old
   ACPI_DEBUGGER_EXEC() stub mechanism.
5. Add x86 acpi_os_readable() support.

v3:
1. Remove acpi_os_readable() support from this patchset. It's sent separately.
2. Delete some deprecated comments.

v4:
1. Rebase patch 4/6 because of Kconfig changes.
2. Include acpi_os_readable() back as no objections, also test result is
   positive.

Chen Yu (1):
  ACPI / x86: introduce acpi_os_readable() support

Colin Ian King (1):
  ACPICA: Debugger: Remove unnecessary status check

Lv Zheng (5):
  ACPICA: Debugger: Convert some mechanisms to OSPM specific
  ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using
    different stub mechanism
  ACPI / debugger: Add IO interface to access debugger functionalities
  tools/power/acpi: Add userspace AML interface support
  ACPI / debugger: Add module support for ACPI debugger

 arch/x86/Kconfig                         |    1 +
 arch/x86/include/asm/acenv.h             |    1 +
 arch/x86/kernel/acpi/boot.c              |   44 ++
 drivers/acpi/Kconfig                     |   20 +-
 drivers/acpi/Makefile                    |    1 +
 drivers/acpi/acpi_dbg.c                  |  805 ++++++++++++++++++++++++++++++
 drivers/acpi/acpica/acdebug.h            |   36 +-
 drivers/acpi/acpica/acglobal.h           |    5 -
 drivers/acpi/acpica/acmacros.h           |   11 -
 drivers/acpi/acpica/dbdisply.c           |   12 +
 drivers/acpi/acpica/dbinput.c            |  100 +---
 drivers/acpi/acpica/dbxface.c            |   93 ++--
 drivers/acpi/acpica/dscontrol.c          |   10 +-
 drivers/acpi/acpica/dsutils.c            |   16 +-
 drivers/acpi/acpica/dswexec.c            |   16 +-
 drivers/acpi/acpica/utmutex.c            |   17 -
 drivers/acpi/bus.c                       |    1 +
 drivers/acpi/osl.c                       |  262 +++++++++-
 include/acpi/acpiosxf.h                  |   18 +-
 include/acpi/acpixf.h                    |   34 ++
 include/acpi/platform/aclinux.h          |    3 +-
 include/acpi/platform/aclinuxex.h        |    8 +-
 include/linux/acpi.h                     |   71 +++
 tools/power/acpi/Makefile                |   16 +-
 tools/power/acpi/tools/acpidbg/Makefile  |   27 +
 tools/power/acpi/tools/acpidbg/acpidbg.c |  438 ++++++++++++++++
 26 files changed, 1852 insertions(+), 214 deletions(-)
 create mode 100644 drivers/acpi/acpi_dbg.c
 create mode 100644 tools/power/acpi/tools/acpidbg/Makefile
 create mode 100644 tools/power/acpi/tools/acpidbg/acpidbg.c

-- 
1.7.10


WARNING: multiple messages have this Message-ID (diff)
From: Lv Zheng <lv.zheng@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>,
	Andy Lutomirski <luto@kernel.org>
Cc: Lv Zheng <lv.zheng@intel.com>, Lv Zheng <zetalog@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	linux-acpi@vger.kernel.org
Subject: [PATCH v4 0/7] ACPICA / debugger: Add in-kernel AML debugger support
Date: Thu,  3 Dec 2015 10:40:00 +0800	[thread overview]
Message-ID: <cover.1449108825.git.lv.zheng@intel.com> (raw)
In-Reply-To: <cover.1446790780.git.lv.zheng@intel.com>

This patchset enables ACPICA debugger for Linux kernel and implements a
userspace utility to access it.

A. Build the AML debugger
In order to build the kernel support of AML debugger, the following kconfig
items should be enabled:
 CONFIG_ACPI_DEBUG=y
 CONFIG_ACPI_DEBUGGER=y
 CONFIG_DEBUG_FS=y
 CONFIG_ACPI_DEBUGGER_USER=m
The userspace tool can be found at tools/power/acpi/tools/acpidbg. To
build this utility, staying in tools folder and type "make acpi".

B. Load the AML debugger during runtime
In order to use the in-kernel AML debugger, the following command should be
executed using root user:
 # modprobe acpi_dbg
 # mount -t debugfs none /sys/kernel/debug
 # acpidbg

C. Batch mode
In order to support scripts, the userspace utility also supports single
command batch mode:
 # acpidbg -b "help"
 # acpidbg -b "tables"
 # acpidbg -b "find _LID"
 # acpidbg -b "execute \_SB.LID0._LID"
You can find the documentation about the ACPICA debugger commands in:
 https://acpica.org/sites/acpica/files/acpica-reference_17.pdf
 (The latest document can be found at https://acpica.org/documentation)
And refer to the chapter - ACPICA debugger reference to obtain the full
description of the debugger commands. Note that not all commands are
supported by an in-kernel AML debugger.

D. Unload the AML debugger during runtime
After terminating all acpidbg instances, the following command can be
executed to remove the AML debugger from kernel:
 # rmmod acpi_dbg

The following tasks are not completed:
1. .flush() support in the kernel debugger IO driver.
2. multi-commands batch mode.

v2:
1. Fix a help message issue for the userspace acpidbg utility (this is a
   typo fix).
2. Fix a batch mode issue by adding "\n" to the prompt sequence (this was
   lost due to too many rebase cycles).
3. Fix kconfig dependency for an intermediate patch (this is only useful in
   case the latter patches are reverted).
4. Add more accurate runtime debugger stub mechanism and remove old
   ACPI_DEBUGGER_EXEC() stub mechanism.
5. Add x86 acpi_os_readable() support.

v3:
1. Remove acpi_os_readable() support from this patchset. It's sent separately.
2. Delete some deprecated comments.

v4:
1. Rebase patch 4/6 because of Kconfig changes.
2. Include acpi_os_readable() back as no objections, also test result is
   positive.

Chen Yu (1):
  ACPI / x86: introduce acpi_os_readable() support

Colin Ian King (1):
  ACPICA: Debugger: Remove unnecessary status check

Lv Zheng (5):
  ACPICA: Debugger: Convert some mechanisms to OSPM specific
  ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using
    different stub mechanism
  ACPI / debugger: Add IO interface to access debugger functionalities
  tools/power/acpi: Add userspace AML interface support
  ACPI / debugger: Add module support for ACPI debugger

 arch/x86/Kconfig                         |    1 +
 arch/x86/include/asm/acenv.h             |    1 +
 arch/x86/kernel/acpi/boot.c              |   44 ++
 drivers/acpi/Kconfig                     |   20 +-
 drivers/acpi/Makefile                    |    1 +
 drivers/acpi/acpi_dbg.c                  |  805 ++++++++++++++++++++++++++++++
 drivers/acpi/acpica/acdebug.h            |   36 +-
 drivers/acpi/acpica/acglobal.h           |    5 -
 drivers/acpi/acpica/acmacros.h           |   11 -
 drivers/acpi/acpica/dbdisply.c           |   12 +
 drivers/acpi/acpica/dbinput.c            |  100 +---
 drivers/acpi/acpica/dbxface.c            |   93 ++--
 drivers/acpi/acpica/dscontrol.c          |   10 +-
 drivers/acpi/acpica/dsutils.c            |   16 +-
 drivers/acpi/acpica/dswexec.c            |   16 +-
 drivers/acpi/acpica/utmutex.c            |   17 -
 drivers/acpi/bus.c                       |    1 +
 drivers/acpi/osl.c                       |  262 +++++++++-
 include/acpi/acpiosxf.h                  |   18 +-
 include/acpi/acpixf.h                    |   34 ++
 include/acpi/platform/aclinux.h          |    3 +-
 include/acpi/platform/aclinuxex.h        |    8 +-
 include/linux/acpi.h                     |   71 +++
 tools/power/acpi/Makefile                |   16 +-
 tools/power/acpi/tools/acpidbg/Makefile  |   27 +
 tools/power/acpi/tools/acpidbg/acpidbg.c |  438 ++++++++++++++++
 26 files changed, 1852 insertions(+), 214 deletions(-)
 create mode 100644 drivers/acpi/acpi_dbg.c
 create mode 100644 tools/power/acpi/tools/acpidbg/Makefile
 create mode 100644 tools/power/acpi/tools/acpidbg/acpidbg.c

-- 
1.7.10


  parent reply	other threads:[~2015-12-03  2:40 UTC|newest]

Thread overview: 131+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8c1016ca8a570ba7c7a1c9f0f88d73cd83cea490>
2015-10-19  2:24 ` [PATCH v2 00/14] ACPICA: 20150930 Release Lv Zheng
2015-10-19  2:24   ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 01/14] ACPICA: Remove unnecessary conditional compilation Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 02/14] ACPICA: iASL: Add symbolic operator support for Index() operator Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 03/14] ACPICA: Update exception code for "file not found" error Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 04/14] ACPICA: Debugger: Update mutexes used for multithreaded debugger Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 05/14] ACPICA: Update NFIT table to rename a flags field Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:24   ` [PATCH v2 06/14] ACPICA: Improve typechecking, both compile-time and runtime Lv Zheng
2015-10-19  2:24     ` Lv Zheng
2015-10-19  2:25   ` [PATCH v2 07/14] ACPICA: iASL: General cleanup of the file suffix #defines Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19  2:25   ` [PATCH v2 08/14] ACPICA: Linuxize: Export debugger files to Linux Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19  2:25   ` [PATCH v2 09/14] ACPICA: Debugger: Fix "quit/exit" command by cleaning up user commands termination logic Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19 21:04     ` Rafael J. Wysocki
2015-10-20  2:03       ` Zheng, Lv
2015-10-20  2:03         ` Zheng, Lv
2015-10-20  7:14         ` Zheng, Lv
2015-10-20  7:14           ` Zheng, Lv
2015-10-19  2:25   ` [PATCH v2 10/14] ACPICA: Debugger: Fix "terminate" command by cleaning up subsystem shutdown logic Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19  2:25   ` [PATCH v2 11/14] ACPICA: Debugger: Add thread ID support so that single step mode can only apply to the debugger thread Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19  2:25   ` [PATCH v2 12/14] ACPI: Enable build of AML interpreter debugger Lv Zheng
2015-10-19  2:25     ` Lv Zheng
2015-10-19  2:26   ` [PATCH v2 13/14] ACPICA: Debugger: Fix dead lock issue ocurred in single stepping mode Lv Zheng
2015-10-19  2:26     ` Lv Zheng
2015-10-19  2:26   ` [PATCH v2 14/14] ACPICA: Update version to 20150930 Lv Zheng
2015-10-19  2:26     ` Lv Zheng
2015-11-06  6:46 ` [RFC PATCH v2 0/5] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng
2015-11-06  6:46   ` Lv Zheng
2015-11-06  6:46   ` [RFC PATCH v2 1/5] ACPICA: Debugger: Remove unnecessary status check Lv Zheng
2015-11-06  6:46     ` Lv Zheng
2015-11-06  6:47   ` [RFC PATCH v2 2/5] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng
2015-11-06  6:47     ` Lv Zheng
2015-11-06  6:47   ` [RFC PATCH v2 3/5] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng
2015-11-06  6:47     ` Lv Zheng
2015-11-06  6:47   ` [RFC PATCH v2 4/5] tools/power/acpi: Add userspace AML interface support Lv Zheng
2015-11-06  6:47     ` Lv Zheng
2015-11-06  6:47   ` [RFC PATCH v2 5/5] ACPI / debugger: Add module support for ACPI debugger Lv Zheng
2015-11-06  6:47     ` Lv Zheng
2015-11-10  8:21   ` [PATCH v2 0/7] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng
2015-11-10  8:21     ` Lv Zheng
2015-11-10  8:21     ` [PATCH v2 1/7] ACPICA: Debugger: Remove unnecessary status check Lv Zheng
2015-11-10  8:21       ` Lv Zheng
2015-11-10  8:21     ` [PATCH v2 2/7] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng
2015-11-10  8:21       ` Lv Zheng
2015-11-10  8:21     ` [PATCH v2 3/7] ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using different stub mechanism Lv Zheng
2015-11-10  8:21       ` Lv Zheng
2015-11-10  8:22     ` [PATCH v2 4/7] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng
2015-11-10  8:22       ` Lv Zheng
2015-11-10  8:22     ` [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support Lv Zheng
2015-11-10  8:22       ` Lv Zheng
2015-11-10  9:42       ` Chen, Yu C
2015-11-10 10:46         ` Chen, Yu C
2015-11-10 13:04         ` Andy Shevchenko
2015-11-10 13:56           ` Chen, Yu C
2015-11-10 13:56             ` Chen, Yu C
2015-11-11  5:06         ` Zheng, Lv
2015-11-11  5:27           ` Chen, Yu C
2015-11-17  1:49           ` Zheng, Lv
2015-11-10  8:22     ` [PATCH v2 6/7] tools/power/acpi: Add userspace AML interface support Lv Zheng
2015-11-10  8:22       ` Lv Zheng
2015-11-10  8:22     ` [PATCH v2 7/7] ACPI / debugger: Add module support for ACPI debugger Lv Zheng
2015-11-10  8:22       ` Lv Zheng
2015-11-19  6:08   ` [PATCH v3 0/6] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng
2015-11-19  6:08     ` Lv Zheng
2015-11-19  6:08     ` [PATCH v3 1/6] ACPICA: Debugger: Remove unnecessary status check Lv Zheng
2015-11-19  6:08       ` Lv Zheng
2015-11-19  6:08     ` [PATCH v3 2/6] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng
2015-11-19  6:08       ` Lv Zheng
2015-11-19  6:08     ` [PATCH v3 3/6] ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using different stub mechanism Lv Zheng
2015-11-19  6:08       ` Lv Zheng
2015-11-19  6:08     ` [PATCH v3 4/6] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng
2015-11-19  6:08       ` Lv Zheng
2015-11-19  6:08     ` [PATCH v3 5/6] tools/power/acpi: Add userspace AML interface support Lv Zheng
2015-11-19  6:08       ` Lv Zheng
2015-11-19  6:09     ` [PATCH v3 6/6] ACPI / debugger: Add module support for ACPI debugger Lv Zheng
2015-11-19  6:09       ` Lv Zheng
2015-11-19  6:09   ` [PATCH v3] ACPI / x86: introduce acpi_os_readable() support Lv Zheng
2015-11-19  6:09     ` Lv Zheng
2015-12-03  2:40   ` Lv Zheng [this message]
2015-12-03  2:40     ` [PATCH v4 0/7] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng
2015-12-03  2:42     ` [PATCH v4 1/7] ACPICA: Debugger: Remove unnecessary status check Lv Zheng
2015-12-03  2:42       ` Lv Zheng
2015-12-03  2:42     ` [PATCH v4 2/7] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng
2015-12-03  2:42       ` Lv Zheng
2015-12-03  2:42     ` [PATCH v4 3/7] ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using different stub mechanism Lv Zheng
2015-12-03  2:42       ` Lv Zheng
2015-12-03  2:43     ` [PATCH v4 4/7] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng
2015-12-03  2:43       ` Lv Zheng
2015-12-03 22:27       ` Andy Lutomirski
2015-12-03 23:34         ` Rafael J. Wysocki
2015-12-03  2:43     ` [PATCH v4 5/7] tools/power/acpi: Add userspace AML interface support Lv Zheng
2015-12-03  2:43       ` Lv Zheng
2015-12-03  2:43     ` [PATCH v4 6/7] ACPI / debugger: Add module support for ACPI debugger Lv Zheng
2015-12-03  2:43       ` Lv Zheng
2015-12-03  2:43     ` [PATCH v4 7/7] ACPI / x86: introduce acpi_os_readable() support Lv Zheng
2015-12-03  2:43       ` Lv Zheng
2015-12-14 23:28       ` Andy Lutomirski
2015-12-15  6:13         ` Chen, Yu C
2015-12-15  6:13           ` Chen, Yu C
2015-12-15  8:52           ` Zheng, Lv
2015-12-15  8:52             ` Zheng, Lv
2015-12-16  0:25           ` Zheng, Lv
2015-12-16  0:25             ` Zheng, Lv
2015-12-17 16:59             ` Andy Lutomirski
2015-12-22  1:03               ` Chen, Yu C
2015-12-22  1:03                 ` Chen, Yu C
2015-12-22 22:49                 ` Andy Lutomirski
2015-12-23  3:25                   ` Zheng, Lv
2015-12-23  3:25                     ` Zheng, Lv
2015-12-24  1:40                     ` Andy Lutomirski
2015-12-24  7:57                       ` Chen, Yu C
2015-12-24  7:57                         ` Chen, Yu C
2015-12-24  8:01                       ` Chen, Yu C
2015-12-24  8:01                         ` Chen, Yu C
2015-12-14 23:43       ` Rafael J. Wysocki
2015-12-14 23:44     ` [PATCH v4 0/7] ACPICA / debugger: Add in-kernel AML debugger support Rafael J. Wysocki
2015-12-15  2:55       ` Zheng, Lv
2015-12-15  2:55         ` Zheng, Lv
2015-12-24  6:16   ` [PATCH] ACPI / debugger: Fix an issue a flag is modified without locking Lv Zheng
2015-12-24  6:16     ` Lv Zheng
2015-12-25  3:22   ` [PATCH] ACPI / debugger: Fix a redundant mutex unlock issue in acpi_aml_open() Lv Zheng
2015-12-25  3:22     ` Lv Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1449108825.git.lv.zheng@intel.com \
    --to=lv.zheng@intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=zetalog@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.