From: Liav Albani <liavalb@gmail.com>
To: Bernhard Beschow <shentey@gmail.com>, qemu-devel@nongnu.org
Cc: ani@anisinha.ca, imammedo@redhat.com, mst@redhat.com
Subject: Re: [PATCH v3 3/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table
Date: Sun, 27 Feb 2022 20:58:18 +0200 [thread overview]
Message-ID: <6e598f82-e68e-548d-7f72-ea7bcbca0e63@gmail.com> (raw)
In-Reply-To: <BE89AC1C-6ED9-4F1E-9DE6-EB1E2CC863E7@gmail.com>
On 2/27/22 12:48, Bernhard Beschow wrote:
> Am 26. Februar 2022 06:30:18 UTC schrieb Liav Albani <liavalb@gmail.com>:
>> This can allow the guest OS to determine more easily if i8042 controller
>> is present in the system or not, so it doesn't need to do probing of the
>> controller, but just initialize it immediately, before enumerating the
>> ACPI AML namespace.
>>
>> Signed-off-by: Liav Albani <liavalb@gmail.com>
>> ---
>> hw/acpi/aml-build.c | 7 ++++++-
>> hw/i386/acpi-build.c | 8 ++++++++
>> hw/i386/acpi-microvm.c | 9 +++++++++
>> include/hw/acpi/acpi-defs.h | 1 +
>> 4 files changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
>> index 8966e16320..ef5f4cad87 100644
>> --- a/hw/acpi/aml-build.c
>> +++ b/hw/acpi/aml-build.c
>> @@ -2152,7 +2152,12 @@ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f,
>> build_append_int_noprefix(tbl, 0, 1); /* DAY_ALRM */
>> build_append_int_noprefix(tbl, 0, 1); /* MON_ALRM */
>> build_append_int_noprefix(tbl, f->rtc_century, 1); /* CENTURY */
>> - build_append_int_noprefix(tbl, 0, 2); /* IAPC_BOOT_ARCH */
>> + /* IAPC_BOOT_ARCH */
>> + if (f->rev == 1) {
>> + build_append_int_noprefix(tbl, 0, 2);
>> + } else {
>> + build_append_int_noprefix(tbl, f->iapc_boot_arch, 2);
>> + }
>> build_append_int_noprefix(tbl, 0, 1); /* Reserved */
>> build_append_int_noprefix(tbl, f->flags, 4); /* Flags */
>>
>> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
>> index ebd47aa26f..65dbc1ec36 100644
>> --- a/hw/i386/acpi-build.c
>> +++ b/hw/i386/acpi-build.c
>> @@ -192,6 +192,14 @@ static void init_common_fadt_data(MachineState *ms, Object *o,
>> .address = object_property_get_uint(o, ACPI_PM_PROP_GPE0_BLK, NULL)
>> },
>> };
>> + /*
>> + * second bit of 16 but IAPC_BOOT_ARCH indicates presence of 8042 or
>> + * equivalent micro controller. See table 5-10 of APCI spec version 2.0
>> + * (the earliest acpi revision that supports this).
>> + */
>> +
>> + fadt.iapc_boot_arch = isa_check_device_existence("i8042") ? 0x0002 : 0x0000;
> Couldn't qdev_find_recursive() be used here instead? This would also make patch 1 unneccessary. Same below.
>
> Best regards
> Bernhard
I tried it first, but because it tries to find the ID of a device
instead of a type (I look for i8042 type which is a string of the device
type), it didn't work as expected. We don't compare DeviceState id, but
ObjectClass type->name here :)
With my patch we could just find the device without any problem whatsoever.
Best regards,
Liav
next prev parent reply other threads:[~2022-02-27 18:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-26 6:30 [PATCH v3 0/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table Liav Albani
2022-02-26 6:30 ` [PATCH v3 1/4] hw/isa: add function to check for existence of device by its type Liav Albani
2022-02-27 7:27 ` Ani Sinha
2022-02-27 19:03 ` Liav Albani
2022-02-26 6:30 ` [PATCH v3 2/4] tests/acpi: i386: allow FACP acpi table changes Liav Albani
2022-02-27 6:57 ` Ani Sinha
2022-02-26 6:30 ` [PATCH v3 3/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table Liav Albani
2022-02-27 6:56 ` Ani Sinha
2022-02-27 18:59 ` Liav Albani
2022-02-27 10:48 ` Bernhard Beschow
2022-02-27 18:58 ` Liav Albani [this message]
2022-02-27 21:33 ` Bernhard Beschow
2022-02-28 5:01 ` Ani Sinha
2022-02-28 6:56 ` Ani Sinha
2022-02-28 8:47 ` Ani Sinha
2022-02-26 6:30 ` [PATCH v3 4/4] tests/acpi: i386: update FACP table differences Liav Albani
2022-02-27 7:05 ` Ani Sinha
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=6e598f82-e68e-548d-7f72-ea7bcbca0e63@gmail.com \
--to=liavalb@gmail.com \
--cc=ani@anisinha.ca \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.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).