All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zheng, Lv" <lv.zheng@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Brown, Len" <len.brown@intel.com>
Cc: Lv Zheng <zetalog@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: RE: [PATCH v5 0/5] ACPI 2.0: Stop defer-executing module level code
Date: Mon, 26 Sep 2016 07:43:14 +0000	[thread overview]
Message-ID: <1AE640813FDE7649BE1B193DEA596E886A22C8D9@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <8547863.5EfA9Z8BZh@vostro.rjw.lan>

Hi, Rafael

> From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net]
> Subject: Re: [PATCH v5 0/5] ACPI 2.0: Stop defer-executing module level code
> 
> On Friday, September 23, 2016 11:26:26 AM Lv Zheng wrote:
> > After fixing ACPICA internal locking issues, we can enable the correct
> > grammar support for the table loading. The new grammar treats the entire
> > table as TermList rather than ObjectList, thus the module level code should
> > be executed right in place.
> >
> > MLC (module level code) is an ACPICA terminology describing the AML code
> > out of any control method, currently only Type1Opcode (If/Else/While)
> > wrapped MLC code blocks are executed by the AML interpreter after the table
> > loading. But the issue which is fixed by this patchset is:
> >    Not only Type1Opcode, but also Type2Opcode will be executed as MLC and
> >    MLC is not defer-executed after loading the table, but is executed right
> >    in place.
> >
> > The following AML code is assembled into a static loading SSDT, and used
> > as an instrumentation to pry into the de-facto standard AML interpreter
> > behaviors:
> >   Name (ECOK, Zero)
> >   Scope (\)
> >   {
> >       DBUG ("TermList 1")
> >       If (LEqual (ECOK, Zero))
> >       {
> >           DBUG ("TermList 2")
> >           Device (MDEV)
> >           {
> >               DEBUG (TermList 3")
> >               If (CondRefOf (MDEV))
> >               {
> >                   DBUG ("MDEV exists")
> >               }
> >               If (CondRefOf (MDEV._STA))
> >               {
> >                   DBUG ("MDEV._STA exists")
> >               }
> >               If (CondRefOf (\_SB.PCI0.EC))
> >               {
> >                   DBUG ("\\_SB.PCI0.EC exists")
> >               }
> >               Name (_HID, EisaId ("PNP9999"))
> >               Method (_STA, 0, Serialized)
> >               {
> >                   DEBUG ("\\_SB.MDEV._STA")
> >                   Return (0x0F)
> >               }
> >           }
> >           DBUG ("TermList 4")
> >       }
> >       Method (_INI, 0, Serialized)
> >       {
> >           DBUG ("\\_SB._INI")
> >       }
> >   }
> >   Scope (_SB.PCI0)
> >   {
> >       Device (EC)
> >       {
> >           ...
> >       }
> >   }
> > The DBUG function is a function to write the debugging messages into a
> > SystemIo debug port.
> > Running Windows with the BIOS providing this SSDT via RSDT, the following
> > messages are obtained from the debug port:
> >   TermList 1
> >   TermList 2
> >   TermList 3
> >   \_SB.MDEV exists
> >   TermList 4
> >   \_SB._INI
> >   ...
> >
> > This test reveals the de-facto grammar for the AMLCode to us:
> > 1. During the table loading, MLC will be executed by the interpreter, this
> >    is partially supported by the current ACPICA;
> > 2. For SystemIo, not only after the _REG(1, 1) is evaluated (current ACPICA
> >    interpreter limitation), but when the table is being loaded, the
> >    SystemIo (the debugging port) is accessible, this is recently fixed in
> >    the upstream, now all early operation regions are accessible during the
> >    table loading;
> > 3. Not only Type1Opcode, but also Type2Opcode will be executed as MLC and
> >    MLC is not executed after loading the table, but is executed right in
> >    place, the Linux upstream is not compliant to this behavior.
> >
> > The last compliance issue has already been clarified in ACPI 2.0
> > specification, so the compliance issue is not that Linux is not compliant
> > to the de-facto standard OS, but that Linux is not compliant to ACPI 2.0.
> > Definition block tables in fact is defined by the spec as TermList, which
> > has no difference than the control methods, thus the interpretion of the
> > table should be no difference that the control method evaluation:
> >      AMLCode := DefBlockHeader TermList
> >      DefMethod := MethodOp PkgLength NameString MethodFlags TermList
> > Now the new upcoming ACPI specification has been clarified around the above
> > grammar primitives, so we need to implement them for Linux.
> >
> > This patchset also contains 2 required fixes generated to fix the
> > regressions detected by the ACPICA ASLTS tool. The ASLTS 'table' test suite
> > has detected such regressions. The fixes have been accepted by the ACPICA
> > upstream (please refer to the ACPICA upstream URL in the description of the
> > 2 patches). And they are sent to Linux community as urgent materials along
> > with the module level code enabling series. With the additional regression
> > fixes, new grammar changes have passed all ASLTS 'table' cases:
> >   https://bugs.acpica.org/show_bug.cgi?id=1327
> >   https://github.com/acpica/acpica/pull/177
> >
> > Lv Zheng (5):
> >   ACPICA: Tables: Fix "UNLOAD" code path lock issues
> >   ACPICA: Parser: Fix a regression in LoadTable support
> >   ACPI 2.0 / AML: Enable correct ACPI subsystem initialization order
> >     for new table loading mode
> >   ACPI 2.0 / AML: Improve module level execution by moving the
> >     If/Else/While execution to per-table basis
> >   ACPI 2.0 / AML: Fix module level execution by correctly parsing table
> >     as TermList
> 
> [1-2/5] queued up for 4.9.
> 
> The rest I'd prefer to keep in linux-next for some time before they go in,
> so let's make them 4.10 material if not urgent for some reasons.

I see.
We could have [4-5/5] enabling patch pending for a period in order for more validations.
But should we have 3/5 queued up?
It's prepared for the 3rd mode of MLC support.
So it is a no-op for the current Linux kernel.
But having it upstreamed is useful to complete the mode (but not enable it).

I've been asked for why ECDT is implemented in the current way.
If PATCH 3/5 in the upstream, the reviewer should soon realize what the purpose of the ECDT change is.

Thanks and best regards
Lv

  reply	other threads:[~2016-09-26  7:43 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0e65135af51d94db0410c7059f3bc3a2300fc3b5>
2016-05-13  5:35 ` [PATCH v2 0/4] ACPI 2.0: Enable TermList interpretion for table loading Lv Zheng
2016-05-13  5:35   ` Lv Zheng
2016-05-13  5:35   ` [PATCH v2 1/4] ACPICA: Dispatcher: Fix an issue that the opregions created by the linked MLC were not tracked Lv Zheng
2016-05-13  5:35     ` Lv Zheng
2016-05-13  5:35   ` [PATCH v2 2/4] ACPICA: ACPI 2.0, Interpreter: Fix MLC issues by switching to new TermList grammar for table loading Lv Zheng
2016-05-13  5:35     ` Lv Zheng
2016-05-13  5:35   ` [PATCH v2 3/4] ACPI 2.0 / AML: Enable correct ACPI subsystem initialization order for new table loading mode Lv Zheng
2016-05-13  5:35     ` Lv Zheng
2016-05-13  5:35   ` [PATCH v2 4/4] ACPI 2.0 / AML: Fix module level execution by correctly parsing table as TermList Lv Zheng
2016-05-13  5:35     ` Lv Zheng
2016-05-17  0:29   ` [PATCH v2 0/4] ACPI 2.0: Enable TermList interpretion for table loading Zheng, Lv
2016-05-17 23:23     ` Rafael J. Wysocki
2016-05-20  0:57       ` Zheng, Lv
2016-06-10  1:05         ` Rafael J. Wysocki
2016-06-12  1:02           ` Zheng, Lv
2016-06-13 22:59             ` Rafael J. Wysocki
2016-06-20  9:07 ` [PATCH v3 0/5] " Lv Zheng
2016-06-20  9:07   ` Lv Zheng
2016-06-20  9:07   ` [PATCH v3 1/5] ACPICA: Namespace: Fix a regression that MLC support triggers dead lock in dynamic " Lv Zheng
2016-06-20  9:07     ` Lv Zheng
2016-06-20 10:57     ` Mika Westerberg
2016-06-20 10:57       ` Mika Westerberg
2016-06-20 23:13       ` Zheng, Lv
2016-06-20  9:07   ` [PATCH v3 2/5] ACPICA: Dispatcher: Fix an issue that the opregions created by the linked MLC were not tracked Lv Zheng
2016-06-20  9:07     ` Lv Zheng
2016-06-20  9:07   ` [PATCH v3 3/5] ACPICA: ACPI 2.0, Interpreter: Fix MLC issues by switching to new TermList grammar for table loading Lv Zheng
2016-06-20  9:07     ` Lv Zheng
2016-06-20  9:07   ` [PATCH v3 4/5] ACPI 2.0 / AML: Enable correct ACPI subsystem initialization order for new table loading mode Lv Zheng
2016-06-20  9:07     ` Lv Zheng
2016-06-20  9:07   ` [PATCH v3 5/5] ACPI 2.0 / AML: Fix module level execution by correctly parsing table as TermList Lv Zheng
2016-06-20  9:07     ` Lv Zheng
2016-06-21  4:34 ` [PATCH v4 0/5] ACPI 2.0: Enable TermList interpretion for table loading Lv Zheng
2016-06-21  4:34   ` Lv Zheng
2016-06-21  4:34   ` [PATCH v4 1/5] ACPICA: Namespace: Fix a regression that MLC support triggers dead lock in dynamic " Lv Zheng
2016-06-21  4:34     ` Lv Zheng
2016-06-21  7:58     ` Mika Westerberg
2016-06-21  9:55       ` Zheng, Lv
2016-06-23  0:41         ` Rafael J. Wysocki
2016-06-21  4:34   ` [PATCH v4 2/5] ACPICA: Dispatcher: Fix an issue that the opregions created by the linked MLC were not tracked Lv Zheng
2016-06-21  4:34     ` Lv Zheng
2016-06-21  4:34   ` [PATCH v4 3/5] ACPICA: ACPI 2.0, Interpreter: Fix MLC issues by switching to new TermList grammar for table loading Lv Zheng
2016-06-21  4:34     ` Lv Zheng
2016-07-04 23:42     ` Zheng, Lv
2016-07-05  0:09       ` Rafael J. Wysocki
2016-06-21  4:34   ` [PATCH v4 4/5] ACPI 2.0 / AML: Enable correct ACPI subsystem initialization order for new table loading mode Lv Zheng
2016-06-21  4:34     ` Lv Zheng
2016-06-21  4:34   ` [PATCH v4 5/5] ACPI 2.0 / AML: Fix module level execution by correctly parsing table as TermList Lv Zheng
2016-06-21  4:34     ` Lv Zheng
2016-09-23  3:26 ` [PATCH v5 0/5] ACPI 2.0: Stop defer-executing module level code Lv Zheng
2016-09-23  3:26   ` Lv Zheng
2016-09-23  3:26   ` [PATCH v5 1/5] ACPICA: Tables: Fix "UNLOAD" code path lock issues Lv Zheng
2016-09-23  3:26     ` Lv Zheng
2016-09-23  3:26   ` [PATCH v5 2/5] ACPICA: Parser: Fix a regression in LoadTable support Lv Zheng
2016-09-23  3:26     ` Lv Zheng
2016-09-23  3:26   ` [PATCH v5 3/5] ACPI 2.0 / AML: Enable correct ACPI subsystem initialization order for new table loading mode Lv Zheng
2016-09-23  3:26     ` Lv Zheng
2016-09-23  3:26   ` [PATCH v5 4/5] ACPI 2.0 / AML: Improve module level execution by moving the If/Else/While execution to per-table basis Lv Zheng
2016-09-23  3:26     ` Lv Zheng
2016-11-24 21:16     ` Rafael J. Wysocki
2016-09-23  3:27   ` [PATCH v5 5/5] ACPI 2.0 / AML: Fix module level execution by correctly parsing table as TermList Lv Zheng
2016-09-23  3:27     ` Lv Zheng
2016-09-24  0:32   ` [PATCH v5 0/5] ACPI 2.0: Stop defer-executing module level code Rafael J. Wysocki
2016-09-26  7:43     ` Zheng, Lv [this message]
2016-09-26 12:57       ` Rafael J. Wysocki

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=1AE640813FDE7649BE1B193DEA596E886A22C8D9@SHSMSX101.ccr.corp.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=rjw@rjwysocki.net \
    --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.