qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Bernhard Beschow <shentey@gmail.com>
Cc: qemu-devel@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Ani Sinha" <ani@anisinha.ca>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 2/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu
Date: Mon, 16 Jan 2023 16:51:18 +0100	[thread overview]
Message-ID: <20230116165118.5d4d6f0a@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20230114222738.282478-3-shentey@gmail.com>

On Sat, 14 Jan 2023 23:27:33 +0100
Bernhard Beschow <shentey@gmail.com> wrote:

> The only function ever assigned to AcpiDeviceIfClass::madt_cpu is
> pc_madt_cpu_entry() which doesn't use the AcpiDeviceIf parameter.

intent for AcpiDeviceIfClass::madt_cpu is to make cpu hotplug AML
reusable (so it's not x86, specific and applicable to other target
that use ACPI with it's own madt_entry definition (think about
arm/virt machine)).

Indeed  (AcpiDeviceIf *adev) is unused and it is there only for
AcpiDeviceIfClass callbacks consistent signature. Other than
I don't see any possible use for adev within madt_cpu()

so
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>  include/hw/acpi/acpi_dev_interface.h | 3 +--
>  include/hw/i386/pc.h                 | 6 ++----
>  hw/acpi/acpi-x86-stub.c              | 5 ++---
>  hw/acpi/cpu.c                        | 3 +--
>  hw/i386/acpi-common.c                | 7 +++----
>  5 files changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
> index ea6056ab92..a1648220ff 100644
> --- a/include/hw/acpi/acpi_dev_interface.h
> +++ b/include/hw/acpi/acpi_dev_interface.h
> @@ -52,8 +52,7 @@ struct AcpiDeviceIfClass {
>      /* <public> */
>      void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
>      void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev);
> -    void (*madt_cpu)(AcpiDeviceIf *adev, int uid,
> -                     const CPUArchIdList *apic_ids, GArray *entry,
> +    void (*madt_cpu)(int uid, const CPUArchIdList *apic_ids, GArray *entry,
>                       bool force_enabled);
>  };
>  #endif
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 991f905f5d..a0647165d1 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -9,7 +9,6 @@
>  #include "hw/block/flash.h"
>  #include "hw/i386/x86.h"
>  
> -#include "hw/acpi/acpi_dev_interface.h"
>  #include "hw/hotplug.h"
>  #include "qom/object.h"
>  #include "hw/i386/sgx-epc.h"
> @@ -193,9 +192,8 @@ bool pc_system_ovmf_table_find(const char *entry, uint8_t **data,
>  void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);
>  
>  /* hw/i386/acpi-common.c */
> -void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
> -                       const CPUArchIdList *apic_ids, GArray *entry,
> -                       bool force_enabled);
> +void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
> +                       GArray *entry, bool force_enabled);
>  
>  /* sgx.c */
>  void pc_machine_init_sgx_epc(PCMachineState *pcms);
> diff --git a/hw/acpi/acpi-x86-stub.c b/hw/acpi/acpi-x86-stub.c
> index 3df1e090f4..d0d399d26b 100644
> --- a/hw/acpi/acpi-x86-stub.c
> +++ b/hw/acpi/acpi-x86-stub.c
> @@ -2,9 +2,8 @@
>  #include "hw/i386/pc.h"
>  #include "hw/i386/acpi-build.h"
>  
> -void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
> -                       const CPUArchIdList *apic_ids, GArray *entry,
> -                       bool force_enabled)
> +void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
> +                       GArray *entry, bool force_enabled)
>  {
>  }
>  
> diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
> index 9148b3a49e..c59a0acbf1 100644
> --- a/hw/acpi/cpu.c
> +++ b/hw/acpi/cpu.c
> @@ -357,7 +357,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
>      char *cphp_res_path = g_strdup_printf("%s." CPUHP_RES_DEVICE, res_root);
>      Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL);
>      AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(obj);
> -    AcpiDeviceIf *adev = ACPI_DEVICE_IF(obj);
>  
>      cpu_ctrl_dev = aml_device("%s", cphp_res_path);
>      {
> @@ -668,7 +667,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,
>  
>              /* build _MAT object */
>              assert(adevc && adevc->madt_cpu);
> -            adevc->madt_cpu(adev, i, arch_ids, madt_buf,
> +            adevc->madt_cpu(i, arch_ids, madt_buf,
>                              true); /* set enabled flag */
>              aml_append(dev, aml_name_decl("_MAT",
>                  aml_buffer(madt_buf->len, (uint8_t *)madt_buf->data)));
> diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c
> index 4aaafbdd7b..52e5c1439a 100644
> --- a/hw/i386/acpi-common.c
> +++ b/hw/i386/acpi-common.c
> @@ -33,9 +33,8 @@
>  #include "acpi-build.h"
>  #include "acpi-common.h"
>  
> -void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
> -                       const CPUArchIdList *apic_ids, GArray *entry,
> -                       bool force_enabled)
> +void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids,
> +                       GArray *entry, bool force_enabled)
>  {
>      uint32_t apic_id = apic_ids->cpus[uid].arch_id;
>      /* Flags – Local APIC Flags */
> @@ -112,7 +111,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *linker,
>      build_append_int_noprefix(table_data, 1 /* PCAT_COMPAT */, 4); /* Flags */
>  
>      for (i = 0; i < apic_ids->len; i++) {
> -        adevc->madt_cpu(adev, i, apic_ids, table_data, false);
> +        adevc->madt_cpu(i, apic_ids, table_data, false);
>          if (apic_ids->cpus[i].arch_id > 254) {
>              x2apic_mode = true;
>          }



  reply	other threads:[~2023-01-16 15:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14 22:27 [PATCH 0/7] AML Housekeeping Bernhard Beschow
2023-01-14 22:27 ` [PATCH 1/7] hw/acpi: Add missing includes Bernhard Beschow
2023-01-16  6:46   ` Markus Armbruster
2023-01-16  8:56     ` Bernhard Beschow
2023-01-16 13:02       ` Markus Armbruster
2023-01-16 13:30         ` Bernhard Beschow
2023-01-14 22:27 ` [PATCH 2/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu Bernhard Beschow
2023-01-16 15:51   ` Igor Mammedov [this message]
2023-01-14 22:27 ` [PATCH 3/7] hw/acpi/acpi_dev_interface: Resolve AcpiDeviceIfClass::madt_cpu Bernhard Beschow
2023-01-14 22:27 ` [PATCH 4/7] hw/i386/acpi-build: Remove unused attributes Bernhard Beschow
2023-01-16  9:09   ` Philippe Mathieu-Daudé
2023-01-14 22:27 ` [PATCH 5/7] hw/acpi/acpi_aml_interface: Extract qbus_build_aml() Bernhard Beschow
2023-01-16  9:13   ` Philippe Mathieu-Daudé
2023-01-14 22:27 ` [PATCH 6/7] hw/i386/acpi-microvm: Reuse qbus_build_aml() Bernhard Beschow
2023-01-16  9:14   ` Philippe Mathieu-Daudé
2023-01-16 14:02     ` Bernhard Beschow
2023-01-16 14:18       ` Bernhard Beschow
2023-01-16 14:22       ` Philippe Mathieu-Daudé
2023-01-14 22:27 ` [PATCH 7/7] hw/isa/isa-bus: Remove now unused isa_build_aml() Bernhard Beschow
2023-01-16  9:14   ` Philippe Mathieu-Daudé

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=20230116165118.5d4d6f0a@imammedo.users.ipa.redhat.com \
    --to=imammedo@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).