From: Laszlo Ersek <lersek@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Aleksei Kovura <alex3kov@zoho.com>,
Igor Mammedov <imammedo@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, "Richard W.M. Jones" <rjones@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] acpi: stash the OEM ID and OEM Table ID fields from an external SLIC table
Date: Thu, 14 Jan 2016 17:38:10 +0100 [thread overview]
Message-ID: <5697CEF2.3010503@redhat.com> (raw)
In-Reply-To: <20160114121538-mutt-send-email-mst@redhat.com>
On 01/14/16 11:21, Michael S. Tsirkin wrote:
> On Thu, Jan 14, 2016 at 02:36:56AM +0100, Laszlo Ersek wrote:
>> The SLIC table is not generated by QEMU. If the user specifies an external
>> one however, then board-specific code might want to adapt other,
>> auto-generated tables to it. This patch saves the OEM ID and OEM Table ID
>> fields from the SLIC, and leaves the actual utilization to board code (the
>> next patch).
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com> (supporter:ACPI/SMBIOS)
>> Cc: Igor Mammedov <imammedo@redhat.com> (supporter:ACPI/SMBIOS)
>> Cc: Richard W.M. Jones <rjones@redhat.com>
>> Cc: Aleksei Kovura <alex3kov@zoho.com>
>> Cc: Michael Tokarev <mjt@tls.msk.ru>
>> RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>> include/hw/acpi/acpi.h | 2 ++
>> hw/acpi/core.c | 18 ++++++++++++++++++
>> 2 files changed, 20 insertions(+)
>>
>> diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
>> index b20bd55..407197a 100644
>> --- a/include/hw/acpi/acpi.h
>> +++ b/include/hw/acpi/acpi.h
>> @@ -189,6 +189,8 @@ void acpi_update_sci(ACPIREGS *acpi_regs, qemu_irq irq);
>> extern int acpi_enabled;
>> extern char unsigned *acpi_tables;
>> extern size_t acpi_tables_len;
>> +extern char *acpi_slic_oem_id;
>> +extern char *acpi_slic_oem_table_id;
>>
>> uint8_t *acpi_table_first(void);
>> uint8_t *acpi_table_next(uint8_t *current);
>
> This seems rather messy.
> How about an API to find SLIC and return the IDs
> from the installed tables?
If testing confirms this idea is worthwhile, I won't object to your
suggestion. I admit I don't readily recall how the externally provided
tables are represented in that big concatenated blob, but perhaps I can
look at acpi_table_first() / acpi_table_next(). (Or just stare at the
code longer.)
So: fair enough, thanks.
Laszlo
>
>> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
>> index 21e113d..7046035 100644
>> --- a/hw/acpi/core.c
>> +++ b/hw/acpi/core.c
>> @@ -54,6 +54,8 @@ static const char unsigned dfl_hdr[ACPI_TABLE_HDR_SIZE - ACPI_TABLE_PFX_SIZE] =
>>
>> char unsigned *acpi_tables;
>> size_t acpi_tables_len;
>> +char *acpi_slic_oem_id;
>> +char *acpi_slic_oem_table_id;
>>
>> static QemuOptsList qemu_acpi_opts = {
>> .name = "acpi",
>> @@ -227,6 +229,22 @@ static void acpi_table_install(const char unsigned *blob, size_t bloblen,
>> /* recalculate checksum */
>> ext_hdr->checksum = acpi_checksum((const char unsigned *)ext_hdr +
>> ACPI_TABLE_PFX_SIZE, acpi_payload_size);
>> +
>> + /* If the table signature is SLIC, stash the OEM ID and OEM Table ID
>> + * fields, so we can later adapt the RSDT and the FADT.
>> + */
>> + if (memcmp(ext_hdr->sig, "SLIC", 4) == 0) {
>> + g_free(acpi_slic_oem_id);
>> + acpi_slic_oem_id = g_malloc(sizeof ext_hdr->oem_id + 1);
>> + memcpy(acpi_slic_oem_id, ext_hdr->oem_id, sizeof ext_hdr->oem_id);
>> + acpi_slic_oem_id[sizeof ext_hdr->oem_id] = '\0';
>> +
>> + g_free(acpi_slic_oem_table_id);
>> + acpi_slic_oem_table_id = g_malloc(sizeof ext_hdr->oem_table_id + 1);
>> + memcpy(acpi_slic_oem_table_id, ext_hdr->oem_table_id,
>> + sizeof ext_hdr->oem_table_id);
>> + acpi_slic_oem_table_id[sizeof ext_hdr->oem_table_id] = '\0';
>> + }
>> }
>>
>> void acpi_table_add(const QemuOpts *opts, Error **errp)
>> --
>> 1.8.3.1
>>
next prev parent reply other threads:[~2016-01-14 16:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 1:36 [Qemu-devel] [PATCH 0/4] set the OEM fields in the RSDT and the FADT from the SLIC Laszlo Ersek
2016-01-14 1:36 ` [Qemu-devel] [PATCH 1/4] acpi: take oem_id in build_header(), optionally Laszlo Ersek
2016-01-14 1:36 ` [Qemu-devel] [PATCH 2/4] acpi: expose oem_id and oem_table_id in build_rsdt() Laszlo Ersek
2016-01-14 1:36 ` [Qemu-devel] [PATCH 3/4] acpi: stash the OEM ID and OEM Table ID fields from an external SLIC table Laszlo Ersek
2016-01-14 10:21 ` Michael S. Tsirkin
2016-01-14 16:38 ` Laszlo Ersek [this message]
2016-01-14 1:36 ` [Qemu-devel] [PATCH 4/4] pc: set the OEM fields in the RSDT and the FADT from the SLIC Laszlo Ersek
2016-01-14 10:24 ` Michael S. Tsirkin
2016-01-14 16:44 ` Laszlo Ersek
2016-01-14 17:09 ` Laszlo Ersek
2016-01-14 10:03 ` [Qemu-devel] [PATCH 0/4] " Richard W.M. Jones
2016-01-14 10:06 ` Alex
2016-01-14 10:23 ` Richard W.M. Jones
2016-01-14 16:35 ` Laszlo Ersek
2016-01-15 16:07 ` Richard W.M. Jones
2016-01-15 16:13 ` Alex
2016-01-21 11:37 ` Richard W.M. Jones
2016-01-21 11:42 ` Michael Tokarev
2016-01-21 11:44 ` Richard W.M. Jones
2016-01-21 11:55 ` Laszlo Ersek
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=5697CEF2.3010503@redhat.com \
--to=lersek@redhat.com \
--cc=alex3kov@zoho.com \
--cc=imammedo@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.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 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).