From: Igor Mammedov <imammedo@redhat.com>
To: Ani Sinha <ani@anisinha.ca>
Cc: qemu-stable@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org,
"Dmitry V . Orekhov" <dima.orekhov@gmail.com>,
Marian Postevca <posteuca@mutex.one>
Subject: Re: [PATCH 3/4] acpi: fix OEM ID/OEM Table ID padding
Date: Tue, 1 Feb 2022 08:39:22 +0100 [thread overview]
Message-ID: <20220201083922.73428015@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2201311942130.1491657@anisinha-lenovo>
On Mon, 31 Jan 2022 19:51:24 +0530 (IST)
Ani Sinha <ani@anisinha.ca> wrote:
> On Mon, 31 Jan 2022, Igor Mammedov wrote:
>
> > On Mon, 31 Jan 2022 18:58:57 +0530 (IST)
> > Ani Sinha <ani@anisinha.ca> wrote:
> >
> > > On Mon, 31 Jan 2022, Igor Mammedov wrote:
> > >
> > > > On Mon, 31 Jan 2022 11:47:00 +0530
> > > > Ani Sinha <ani@anisinha.ca> wrote:
> > > >
> > > > > On Wed, Jan 12, 2022 at 6:33 PM Igor Mammedov <imammedo@redhat.com> wrote:
> > > > > >
> > > > > > Commit [2] broke original '\0' padding of OEM ID and OEM Table ID
> > > > > > fields in headers of ACPI tables. While it doesn't have impact on
> > > > > > default values since QEMU uses 6 and 8 characters long values
> > > > > > respectively, it broke usecase where IDs are provided on QEMU CLI.
> > > > > > It shouldn't affect guest (but may cause licensing verification
> > > > > > issues in guest OS).
> > > > > > One of the broken usecases is user supplied SLIC table with IDs
> > > > > > shorter than max possible length, where [2] mangles IDs with extra
> > > > > > spaces in RSDT and FADT tables whereas guest OS expects those to
> > > > > > mirror the respective values of the used SLIC table.
> > > > > >
> > > > > > Fix it by replacing whitespace padding with '\0' padding in
> > > > > > accordance with [1] and expectations of guest OS
> > > > > >
> > > > > > 1) ACPI spec, v2.0b
> > > > > > 17.2 AML Grammar Definition
> > > > > > ...
> > > > > > //OEM ID of up to 6 characters. If the OEM ID is
> > > > > > //shorter than 6 characters, it can be terminated
> > > > > > //with a NULL character.
> > > > >
> > > > > On the other hand, from
> > > > > https://uefi.org/specs/ACPI/6.4/21_ACPI_Data_Tables_and_Table_Def_Language/ACPI_Data_Tables.html
> > > > > ,
> > > > >
> > > > > "For example, the OEM ID and OEM Table ID in the common ACPI table
> > > > > header (shown above) are fixed at six and eight characters,
> > > > > respectively. They are not necessarily null terminated"
> > > > >
> > > > > I also checked version 5 and the verbiage is the same. I think not
> > > > > terminating with a null is not incorrect.
> > > >
> > > > I have a trouble with too much 'not' within the sentence.
> > >
> > > :-)
> > >
> > > > So what's the point of this comment and how it's related to
> > > > this patch?
> > >
> > > My understanding of the spec is that null termination of both those IDs is
> > > not mandatory. Guests may get confused or expect the strings to be null
> > > termimated but they should really be open to expecting non-null terminated
> > > strings as well. What is important is that the number of chars of those
> > > two strings are fixed and well defined in the spec and qemu
> > > implementation.
> > >
> > > In any case, I think we can leave the patch as is for now and see if the
> > > change causes trouble with other guests.
> >
> >
> > these fields have a fixed length so one doesn't need terminating NULL
> > in case the full length of the field is utilized, otherwise in case of
> > where the value is shorter than max length it has to be null terminated
> > to express a shorter value. That way QEMU worked for years until
> > 602b458201 introduced regression.
> >
>
> My comment was based on what I interpreted from reading the latest
> version of the specs. I guess the spec does not explicitly say what the
> padding
> bytes would be in case the length of the IDs are less the max length. I
> interpreted the wording to mean that whether or not the
> length of the string is shorter, one should not expect it to terminate with null.
that's what AML grmamar quoted in commit message clarifies
for specific field(s), as opposed to your generic string
type description
> It would be nice if a future version of the spec made is explicit and
> clearer.
PS:
you were asking the other day if there is any bugs left in ACPI,
(the answer is that I'm not aware of any).
But there are issues with SMBIOS tables that need to be fixed
(it's corner cases with large VM configurations), are you
interested in trying to fix it?
next prev parent reply other threads:[~2022-02-01 8:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 13:03 [PATCH 0/4] acpi: fix short OEM [Table] ID padding Igor Mammedov
2022-01-12 13:03 ` [PATCH 1/4] tests: acpi: manually pad OEM_ID/OEM_TABLE_ID for test_oem_fields() test Igor Mammedov
2022-01-12 13:44 ` Michael S. Tsirkin
2022-01-14 11:48 ` Igor Mammedov
2022-01-14 13:09 ` Michael S. Tsirkin
2022-01-12 13:03 ` [PATCH 2/4] tests: acpi: whitelist nvdimm's SSDT and FACP.slic expected blobs Igor Mammedov
2022-01-12 13:03 ` [PATCH 3/4] acpi: fix OEM ID/OEM Table ID padding Igor Mammedov
2022-01-12 13:39 ` Michael S. Tsirkin
2022-01-12 15:16 ` Ani Sinha
2022-01-12 15:28 ` Michael S. Tsirkin
2022-01-12 15:19 ` Ani Sinha
2022-01-13 9:53 ` Dmitry V. Orekhov
2022-01-13 10:22 ` Ani Sinha
2022-01-13 13:19 ` Dmitry V. Orekhov
2022-01-31 6:17 ` Ani Sinha
2022-01-31 13:20 ` Igor Mammedov
2022-01-31 13:28 ` Ani Sinha
2022-01-31 14:10 ` Igor Mammedov
2022-01-31 14:21 ` Ani Sinha
2022-02-01 7:39 ` Igor Mammedov [this message]
2022-02-01 7:55 ` Ani Sinha
2022-02-01 9:14 ` Igor Mammedov
2022-01-12 13:03 ` [PATCH 4/4] tests: acpi: update expected blobs Igor Mammedov
2022-01-12 15:13 ` Ani Sinha
2022-01-14 14:26 ` [PATCH 5/4] tests: acpi: test short OEM_ID/OEM_TABLE_ID values in test_oem_fields() Igor Mammedov
2022-01-14 14:53 ` Ani Sinha
2022-01-31 13:21 ` [PATCH 0/4] acpi: fix short OEM [Table] ID padding Igor Mammedov
2022-01-31 13:37 ` Michael S. Tsirkin
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=20220201083922.73428015@redhat.com \
--to=imammedo@redhat.com \
--cc=ani@anisinha.ca \
--cc=dima.orekhov@gmail.com \
--cc=mst@redhat.com \
--cc=posteuca@mutex.one \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).