public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Amos Kong <akong@redhat.com>,
	"Kevin O'Connor" <kevin@koconnor.net>,
	seabios@seabios.org, kvm@vger.kernel.org, jasowang@redhat.com,
	alex williamson <alex.williamson@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH 2/4] acpi: add aml/asl parsing script
Date: Wed, 21 Sep 2011 18:46:49 +0300	[thread overview]
Message-ID: <20110921154649.GA20940@redhat.com> (raw)
In-Reply-To: <20110921142732.GU21417@redhat.com>

On Wed, Sep 21, 2011 at 05:27:32PM +0300, Gleb Natapov wrote:
> On Wed, Sep 21, 2011 at 03:44:29PM +0300, Michael S. Tsirkin wrote:
> > script ./src/find_ej0.pl finds all instances of
> > method named EJ0_ and the matching _ADR information,
> > and outputs the AML offset and slot mask of each.
> > 
> There is tools/ directory for such kind of scripts. Most (if not all) of
> scripts there are in python though.

OK, rewriting that in python should be easy.
I'll wait a bit for more comments on the design though.

> Perl should die painful death.
> 
> This approach delivers nice result, but since the script does not really
> decodes AML, but tries to match ASL source code with regular expressions,
> it introduces some assumptions to the code that make DSDT code less
> hackable. I'll hate to be the one who will have to change PCI device
> definitions in DSDT next time.

There are three requirements now:
1. don't use the name EJ0_ anywhere if you don't want it patches
2. _ADR must be an integer constant
3. put _ADR name immediately before EJ0_ method
I tried to make it easy to obey these rules
by adding comments in source code.

I don't believe a generic mechanism that does not place
any restrictions on language use is possible without adding an
AML interpreter in bios.

> Generally speaking finding an offset of some scope in AML is useful not
> only for PCI hotplug. For instance we want to make S3/S4 capability
> configurable by a command line switch, but this also requires DSDT
> patching and having automatic way to find _S3_/_S4_ offset is required
> for that too (we do not what to find it by hand each time DSDT is
> recompiled).

Right. So that would be an easy extension.
We could also add some directives for the tool
(e.g. in C comments) so that you can e.g. find more names
just by adding such a directive in dsl.

I'll be happy to work on that preferably
after we merge a simple version of the tool first.


  reply	other threads:[~2011-09-21 15:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 12:44 [PATCH 0/4] acpi: fix up EJ0 in DSDT Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 1/4] acpi: generate mixed asl/aml listing Michael S. Tsirkin
2011-09-21 12:47   ` Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 2/4] acpi: add aml/asl parsing script Michael S. Tsirkin
2011-09-21 14:27   ` Gleb Natapov
2011-09-21 15:46     ` Michael S. Tsirkin [this message]
2011-09-21 18:10   ` Michael S. Tsirkin, Kevin O'Connor
2011-09-21 12:44 ` [PATCH 3/4] acpi: EJ0 method name patching Michael S. Tsirkin
2011-09-21 12:44 ` [PATCH 4/4] acpi: remove _RMV Michael S. Tsirkin
2011-09-22  4:35 ` [PATCH 0/4] acpi: fix up EJ0 in DSDT Kevin O'Connor
2011-09-22  6:09   ` Michael S. Tsirkin
2011-09-22 12:39     ` Kevin O'Connor
2011-09-26  4:40     ` Kevin O'Connor
2011-09-26  7:03       ` [SeaBIOS] " Rudolf Marek
2011-09-26  7:04       ` Michael S. Tsirkin
2011-09-26 11:36         ` Marcelo Tosatti
2011-09-26 13:13           ` Michael S. Tsirkin
2011-09-27  0:04         ` Kevin O'Connor
2011-09-27 13:04           ` Michael S. Tsirkin
2011-09-27 15:23             ` Paolo Bonzini

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=20110921154649.GA20940@redhat.com \
    --to=mst@redhat.com \
    --cc=akong@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=seabios@seabios.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox