All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Georgi <pgeorgi at google.com>
To: devel@acpica.org
Subject: Re: [Devel] Field Offset constraints
Date: Thu, 04 Apr 2019 22:35:52 +0200	[thread overview]
Message-ID: <CAE-gjdVWp1XS1BiLBQdWm7ZKZ7yr0C2iz4fB3QU8N2JMZYVKSg@mail.gmail.com> (raw)
In-Reply-To: CF6A88132359CE47947DB4C6E1709ED53C597C1C@ORSMSX122.amr.corp.intel.com

[-- Attachment #1: Type: text/plain, Size: 5661 bytes --]

One (simple) example would be the mapping between
https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/include/ec_commands.h#269
that
specifies addresses in EC "RAM" space to
https://review.coreboot.org/cgit/coreboot.git/tree/src/ec/google/chromeec/acpi/ec.asl#n42.
Right now, there's relatively little to ensure that (let's say) "FAND" in
the ASL really points to the same address as EC_ACPI_MEM_FAN_DUTY.

Later in the ASL we use Offset to make sure that the bitfield doesn't
exceed the space it has (line 91), as a very weak assertion that the code
is sane.
The ability to concretely specify where each of these fields is supposed to
end up instead having to count would increase the confidence in the ACPI
side of things.

(If things look a bit odd in the ASL: we run it through cpp to support
#include and #define)


Thanks,
Patrick

Am Do., 4. Apr. 2019 um 22:12 Uhr schrieb Schmauss, Erik <
erik.schmauss(a)intel.com>:

> Hi Patrick,
>
>
>
> I assume that you are trying to translate a specification that contains
> diagrams to this ASL OperationRegion. Could you send us an image of what
> this diagram or specification looks like? We don’t need the exact
> specification. I’m just curious as to what this specification looks like.
> Feel free to blank-out any proprietary or sensitive fields.
>
>
>
> Thanks,
>
>
>
> Erik
>
>
>
> *From:* Patrick Georgi [mailto:pgeorgi(a)google.com]
> *Sent:* Wednesday, April 3, 2019 2:52 PM
> *To:* Schmauss, Erik <erik.schmauss(a)intel.com>
> *Cc:* Moore, Robert <robert.moore(a)intel.com>; devel(a)acpica.org
> *Subject:* Re: [Devel] Field Offset constraints
>
>
>
> Hi Erik,
>
> thanks for the encouraging words.
>
>
>
> As mentioned, I think it would be useful to have a mechanism to lock down
> where a field item ends up.
>
> We used to use Offset() for that purpose to make sure that at least we're
> not putting more into a space than fits into it (because Offset() won't
> move backward), but something more comprehensive (that can also identify
> underflow for example) would be nice.
>
>
>
> The (optional) syntax I proposed in my original message (Item (Name, Byte,
> Bit, Length)) wouldn't require changes to the bytecode, but it's a source
> language extension:
>
>
>
> Compile time semantics: If the current position in the Field (that the
> compiler obviously is tracking already) is not Byte/Bit, report an error.
> Otherwise compile the equivalent of "Name, Length,". In particular, Item()
> doesn't emit Offsets, but expects the developer to add them where required.
>
> Runtime semantics: no change (because the bytecode is identical)
>
> Decompiler behavior: free to choose the syntax since all information can
> be derived (name, offsets, length): it could always use the original
> syntax, always the new syntax, some heuristic (maybe to use Item() for the
> field before an Offset() and use the plain Name, Length, variant
> otherwise)... There's a trade-off between expressiveness (more location
> data) and compatibility (with older ASL tools).
>
>
>
>
>
> Thanks,
>
> Patrick
>
>
>
> Am Mi., 3. Apr. 2019 um 23:26 Uhr schrieb Schmauss, Erik <
> erik.schmauss(a)intel.com>:
>
> It’s important for us to hear suggestions so please let us know. If your
> suggestion is useful for all ACPI firmware developers, we would be more
> than happy to propose specification changes or add iASL features!
>
>
>
> Erik
>
>
>
> *From:* Moore, Robert
> *Sent:* Wednesday, April 3, 2019 12:08 PM
> *To:* Patrick Georgi <pgeorgi(a)google.com>
> *Cc:* devel(a)acpica.org; Schmauss, Erik <erik.schmauss(a)intel.com>
> *Subject:* RE: [Devel] Field Offset constraints
>
>
>
> We do in fact keep tightening up the compiler to check for semantic issues
> as well as syntax errors. As it stands today, we have 164
> errors/warnings/remarks, as well as 13 additional errors for the Data Table
> compiler, and 11 errors for the preprocessor.
>
>
>
> Do you have any additional suggestions?
>
>
>
> Bob
>
>
>
>
>
> *From:* Patrick Georgi [mailto:pgeorgi(a)google.com <pgeorgi(a)google.com>]
> *Sent:* Wednesday, April 3, 2019 11:08 AM
> *To:* Moore, Robert <robert.moore(a)intel.com>
> *Cc:* devel(a)acpica.org; Schmauss, Erik <erik.schmauss(a)intel.com>
> *Subject:* Re: [Devel] Field Offset constraints
>
>
>
> Hi Robert,
>
>
>
> Am Mi., 3. Apr. 2019 um 19:38 Uhr schrieb Moore, Robert <
> robert.moore(a)intel.com>:
>
> 2)      Disable the specific remark via the –VW option.
>
> iasl -vw 2158 dsdt.asl   // disable remark #2158
>
> Thank you for the pointer to that option, that's very helpful.
>
>
>
> Independent from that, is there interest in providing language features on
> top of ASL (maybe in revisions to the spec if the tool is meant to remain
> strictly compliant) to more rigorously express constraints that can be
> verified at compile time?
>
>
>
>
>
> Regards,
>
> Patrick
>
> --
>
> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
> Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
> Hamburg
> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>
>
>
>
> --
>
> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
> Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
> Hamburg
> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>


-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 13504 bytes --]

             reply	other threads:[~2019-04-04 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 20:35 Patrick Georgi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-04-05 19:16 [Devel] Field Offset constraints Moore, Robert
2019-04-04 20:12 Schmauss, Erik
2019-04-03 21:51 Patrick Georgi
2019-04-03 21:26 Schmauss, Erik
2019-04-03 19:07 Moore, Robert
2019-04-03 18:07 Patrick Georgi
2019-04-03 17:38 Moore, Robert
2019-04-03  7:14 Patrick Georgi

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=CAE-gjdVWp1XS1BiLBQdWm7ZKZ7yr0C2iz4fB3QU8N2JMZYVKSg@mail.gmail.com \
    --to=devel@acpica.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 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.