qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gal Hammer <ghammer@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive.
Date: Thu, 2 Oct 2014 15:20:44 +0300	[thread overview]
Message-ID: <20141002122044.GA25552@redhat.com> (raw)
In-Reply-To: <1410953992-14542-2-git-send-email-ghammer@redhat.com>

On Wed, Sep 17, 2014 at 02:39:51PM +0300, Gal Hammer wrote:
> Add a 16-bytes buffer to allow storing a 128-bit UUID value in an
> ACPI table.
> 
> Signed-off-by: Gal Hammer <ghammer@redhat.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>


This one looks good. Applied, thanks!

> ---
>  scripts/acpi_extract.py | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/acpi_extract.py b/scripts/acpi_extract.py
> index 22ea468..10c1ffb 100755
> --- a/scripts/acpi_extract.py
> +++ b/scripts/acpi_extract.py
> @@ -139,13 +139,16 @@ def aml_name_string(offset):
>          offset += 1
>      return offset;
>  
> -# Given data offset, find 8 byte buffer offset
> -def aml_data_buffer8(offset):
> -    #0x08 NameOp NameString DataRef
> -    expect = [0x11, 0x0B, 0x0A, 0x08]
> +# Given data offset, find variable length byte buffer offset
> +def aml_data_buffer(offset, length):
> +    #0x11 PkgLength BufferSize ByteList
> +    if (length > 63):
> +        die( "Name offset 0x%x: expected a one byte PkgLength (length<=63)" %
> +             (offset));
> +    expect = [0x11, length+3, 0x0A, length]
>      if (aml[offset:offset+4] != expect):
>          die( "Name offset 0x%x: expected %s actual %s" %
> -             (offset, aml[offset:offset+4], expect))
> +             (offset, expect, aml[offset:offset+4]))
>      return offset + len(expect)
>  
>  # Given data offset, find dword const offset
> @@ -172,9 +175,9 @@ def aml_data_byte_const(offset):
>               (offset, aml[offset]));
>      return offset + 1;
>  
> -# Find name'd buffer8
> -def aml_name_buffer8(offset):
> -    return aml_data_buffer8(aml_name_string(offset) + 4)
> +# Find name'd buffer
> +def aml_name_buffer(offset, length):
> +    return aml_data_buffer(aml_name_string(offset) + 4, length)
>  
>  # Given name offset, find dword const offset
>  def aml_name_dword_const(offset):
> @@ -308,7 +311,9 @@ for i in range(len(asl)):
>          output[array] = aml
>          continue
>      if (directive == "ACPI_EXTRACT_NAME_BUFFER8"):
> -        offset = aml_name_buffer8(offset)
> +        offset = aml_name_buffer(offset, 8)
> +    elif (directive == "ACPI_EXTRACT_NAME_BUFFER16"):
> +        offset = aml_name_buffer(offset, 16)
>      elif (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
>          offset = aml_name_dword_const(offset)
>      elif (directive == "ACPI_EXTRACT_NAME_WORD_CONST"):
> -- 
> 1.9.3
> 

  reply	other threads:[~2014-10-02 12:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 11:39 [Qemu-devel] [PATCH 0/2 V5] Virtual Machine Generation ID Gal Hammer
2014-09-17 11:39 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer
2014-10-02 12:20   ` Michael S. Tsirkin [this message]
2014-09-17 11:39 ` [Qemu-devel] [PATCH 2/2] i386: Add a Virtual Machine Generation ID device Gal Hammer
2014-10-02 12:49   ` Michael S. Tsirkin
2014-10-02 13:14     ` Gal Hammer
2014-10-02 13:30       ` Michael S. Tsirkin
2014-10-01  8:58 ` [Qemu-devel] [PATCH 0/2 V5] Virtual Machine Generation ID Markus Armbruster
2014-10-02  8:32   ` Gal Hammer
2014-10-02  8:46     ` Michael S. Tsirkin
2014-10-02 12:12 ` Michael S. Tsirkin
2014-10-02 12:16   ` Michael S. Tsirkin
2014-10-06  9:06 ` Daniel P. Berrange
2014-10-06 12:48   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2014-09-16 13:04 [Qemu-devel] [PATCH 0/2 V4] " Gal Hammer
2014-09-16 13:04 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer
2014-09-15  7:27 [Qemu-devel] [PATCH 0/2 V3] Virtual Machine Generation ID Gal Hammer
2014-09-15  7:27 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer
2014-09-14  6:25 [Qemu-devel] [PATCH RESEND 0/2 V2] Virtual Machine Generation ID Gal Hammer
2014-09-14  6:25 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer
2014-09-14  8:48   ` Paolo Bonzini
2014-09-02 12:53 [Qemu-devel] [PATCH 0/2 V2] Virtual Machine Generation ID Gal Hammer
2014-09-02 12:53 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer
2014-08-10 11:32 [Qemu-devel] [PATCH 0/2] Virtual Machine Generation ID Gal Hammer
2014-08-10 11:32 ` [Qemu-devel] [PATCH 1/2] i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive Gal Hammer

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=20141002122044.GA25552@redhat.com \
    --to=mst@redhat.com \
    --cc=ghammer@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).