[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 3/4] hw/acpi: add indication for i8042 in IA-PC boot flags
From: |
Ani Sinha |
Subject: |
Re: [PATCH v3 3/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table |
Date: |
Mon, 28 Feb 2022 12:26:04 +0530 (IST) |
User-agent: |
Alpine 2.22 (DEB 394 2020-01-19) |
> > >ObjectClass type->name here :)
> >
> > I see. What about object_resolve_path_type()? It takes a typename
> > parameter. It even tells you if the match is ambiguous if you care.
>
> Yes this is a good suggestion and it will likely work.
> You can get rid of your first patch and only make the following change:
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 65dbc1ec36..d82c39490c 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -38,6 +38,7 @@
> #include "hw/nvram/fw_cfg.h"
> #include "hw/acpi/bios-linker-loader.h"
> #include "hw/isa/isa.h"
> +#include "hw/input/i8042.h"
> #include "hw/block/fdc.h"
> #include "hw/acpi/memory_hotplug.h"
> #include "sysemu/tpm.h"
> @@ -198,7 +199,7 @@ static void init_common_fadt_data(MachineState
> *ms, Object *o,
> * (the earliest acpi revision that supports this).
> */
>
> - fadt.iapc_boot_arch = isa_check_device_existence("i8042") ?
> 0x0002 : 0x0000;
> + fadt.iapc_boot_arch = object_resolve_path_type("", TYPE_I8042,
> NULL) ? 0x0002 : 0x0000;
This might be incorrect if there are more than one device of that type.
You need to check for ambiguity as well.
>
> *data = fadt;
> }
> diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c
> index e5f89164be..502ae61a17 100644
> --- a/hw/i386/acpi-microvm.c
> +++ b/hw/i386/acpi-microvm.c
> @@ -33,6 +33,7 @@
> #include "hw/acpi/erst.h"
> #include "hw/i386/fw_cfg.h"
> #include "hw/i386/microvm.h"
> +#include "hw/input/i8042.h"
> #include "hw/pci/pci.h"
> #include "hw/pci/pcie_host.h"
> #include "hw/usb/xhci.h"
> @@ -195,7 +196,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables,
> * (the earliest acpi revision that supports this).
> */
>
> - pmfadt.iapc_boot_arch = isa_check_device_existence("i8042") ? 0x0002
> + pmfadt.iapc_boot_arch = object_resolve_path_type("", TYPE_I8042,
> NULL) ? 0x0002
> : 0x0000;
>
Ditto.
> table_offsets = g_array_new(false, true /* clear */,
>
> Please re-test your change.
>
- Re: [PATCH v3 1/4] hw/isa: add function to check for existence of device by its type, (continued)
[PATCH v3 4/4] tests/acpi: i386: update FACP table differences, Liav Albani, 2022/02/26