From patchwork Mon Jan 16 15:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 312D6C54EBE for ; Mon, 16 Jan 2023 15:32:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQc-0001F9-T8; Mon, 16 Jan 2023 10:29:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQb-0001Ew-NI; Mon, 16 Jan 2023 10:29:41 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQa-00086L-2F; Mon, 16 Jan 2023 10:29:41 -0500 Received: by mail-ej1-x62d.google.com with SMTP id v6so25908016ejg.6; Mon, 16 Jan 2023 07:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Nx0LGN3Qk/UMV0sF6tMy2QhR6Lgb61/OubAnCadihe8=; b=hilvT145mdSXaimttciNUjFMdDzUNtLeP851z+4Cwk7Pjb78ixX0R+6atpA1E3Tkyv QO1BVK4oKEz3z83rbazKiUjK5PuM/OKL2qnsFBTYO95M/Igv/gJEU7io2pN6j62nf330 dpzOCTa5INmk6bd3NmK+Z+mJioSB1BCz8nbO58we+vraPVLng5xPiKzTRYr6MLrFFM7V yvNLmVTZIyp9vFqD7vY3rg/S65R9h8VyzHaHIOX9ue5LTPb02KrwxziugnDOTZLFiiuE KleSQfaYw3JNh+GYsK3CRRYLyBwpuvQxJcrskd2rLtFCodIUrXcMwfEVA38cKpv1FhDL 7Hyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nx0LGN3Qk/UMV0sF6tMy2QhR6Lgb61/OubAnCadihe8=; b=KBSc3rQ1O0mqTVAhJC/QqkQX9qOx5eViyBoZFvHKgMpNCAs3cY4v2Ks6wsB9BBAeeq aBzSOVTyokpjf/uWR1s7CxoPyyhfb13rN3OYa7eJwenKwJJDlBVWYAqPdh0M9ERgbZ2R 5oxpqWyPT2z/DuqfmjaTj/jDuDFq48xcAnd9Z55Z6/IP4sMh0YUBqFjz7C3RMwZm6Hu0 2++ApqI73SPeMGyd5FzdEqGjo+acdiM0juTj6zrhKqy67/hcwUh6uyhDmweEF4M/XGap 0KT1UF2QheEg7fYqztol5lfMURG0Ckv+I//U+QlpmsZD6cYeCsYOjBTTrFo5HhYArOn9 juOA== X-Gm-Message-State: AFqh2kpgSLxpXbSuYnqiWBEB/henoS4QV2dheIVX7dFyNfSxzMrQvLFl NpnYafbwf/lmrozXLlaAQFdBdugNquU= X-Google-Smtp-Source: AMrXdXvyzEMVg1R9Md05ofa83Dy/JvyQpyHnGK7EjSj0dTAcviIFehySQ23iLZHPFRDQw/vrVSUWLg== X-Received: by 2002:a17:907:34d6:b0:86f:fe8a:2f1c with SMTP id zy22-20020a17090734d600b0086ffe8a2f1cmr4980908ejb.35.1673882977654; Mon, 16 Jan 2023 07:29:37 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:37 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 1/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu Date: Mon, 16 Jan 2023 16:29:02 +0100 Message-Id: <20230116152908.147275-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The only function ever assigned to AcpiDeviceIfClass::madt_cpu is pc_madt_cpu_entry() which doesn't use the AcpiDeviceIf parameter. Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov --- 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 { /* */ 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 4e580959a2..19c154d78f 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -355,7 +355,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); { @@ -666,7 +665,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; } From patchwork Mon Jan 16 15:29:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EFD40C54EBE for ; Mon, 16 Jan 2023 15:30:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQe-0001GX-T1; Mon, 16 Jan 2023 10:29:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQd-0001Fs-Eh; Mon, 16 Jan 2023 10:29:43 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQb-00086W-FQ; Mon, 16 Jan 2023 10:29:43 -0500 Received: by mail-ej1-x631.google.com with SMTP id kt14so10022912ejc.3; Mon, 16 Jan 2023 07:29:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4PbNp5vdywluAchdRAafHmLkvtk2z2v2WXg2KLA4kX4=; b=MikUsbrtH1fMFaWmXttUjxG/eRg8gYNHxLe7ytjp9uacHlTXOmAsIe9+z0+FIMgjSt z+t20BUyLIHDGmhB36nn5LJNdpbfpN0/QFSg4svHStOml5LyiOYjYyVJO8QEGb7gIhLI e7ggbHgRJ1JVU0Ftkhm6XXQ8+uJMslDatBK+THyA8Tu3rxw5j9OiwGW6jGQosOuNX6/5 Q6pYZWa87aAgOJmSSApXM5mn9SfwBiqp0Rqo4flWY7I4NtxrSe2YrfVm4Mg0uaC72Hfy QoRQhLZYl1BCNDxT8CrsFS1wHt+KasGW/r5SnMzRJ9mm8hUMDExn23QG+zMGsCAShNT0 jrjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4PbNp5vdywluAchdRAafHmLkvtk2z2v2WXg2KLA4kX4=; b=vb+vaESPRrhYay29hceQbfOvTDKIsZLOqROHpQIV3m4lLAkGPmY18S+a7xDbFELMxK QqBfv9bIjDl1NhPYwoWRPlc5cAooyS9Q2pXCJrFu87e7jBxNovwxMBWAuj3Bh4/2B+ox bzlFx5GLs/q4da1EeXQgAHt0dr7Ya2IQ2hX8bCt/x2j1WWSmEANzcG+FiugX+nwu7lW6 rbmrE0tJIVByg1wlU+YQcMZapghv8SrQzQMG+h4kOCDqXFChcOPmmAcqSL92XWAGOqsj a8NVdbAVr5iXaq8a5JZ2zOhHoWzR/A+/c+85nyu0PhJe3lVm23+31X+qxmbm+81LHycm 4i4Q== X-Gm-Message-State: AFqh2korQfiXEa+RESSDnw2/RrfOrUM7fWvos6QG9ShscfLgU7ryS6aB hmXm1xKrykY3ikFLbWzRi+GmtFbVNQw= X-Google-Smtp-Source: AMrXdXtelI5vDpKvA2ffi+igRDoY5fazIxOKQ9qLGG7Xv+LTKKb1TO92hEapm8hdRQnhN/xum/Zoeg== X-Received: by 2002:a17:907:a091:b0:7c1:23ef:4bb9 with SMTP id hu17-20020a170907a09100b007c123ef4bb9mr78129040ejc.13.1673882979356; Mon, 16 Jan 2023 07:29:39 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:38 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 2/7] hw/acpi/acpi_dev_interface: Resolve AcpiDeviceIfClass::madt_cpu Date: Mon, 16 Jan 2023 16:29:03 +0100 Message-Id: <20230116152908.147275-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This class attribute was always set to pc_madt_cpu_entry(). pc_madt_cpu_entry() is architecture dependent and was assigned to the attribute even in architecture agnostic code such as in hw/acpi/piix4.c and hw/isa/lpc_ich9. Not having to set madt_cpu there resolves the assumption that these device models are only ever used with ACPI on x86 targets. The only target independent location where madt_cpu was called was hw/ acpi/cpu.c. Here a function pointer can be passed via an argument instead. The other locations where it was called was in x86-specific code where pc_madt_cpu_entry() can be used directly. While at it, move pc_madt_cpu_entry() from the public include/hw/i386/ pc.h to the private hw/i386/acpi-common where it is also implemented. Signed-off-by: Bernhard Beschow --- hw/i386/acpi-common.h | 7 +++++-- include/hw/acpi/acpi_dev_interface.h | 2 -- include/hw/acpi/cpu.h | 6 +++++- include/hw/i386/pc.h | 4 ---- hw/acpi/acpi-x86-stub.c | 6 ------ hw/acpi/cpu.c | 10 ++++------ hw/acpi/piix4.c | 2 -- hw/i386/acpi-build.c | 5 ++--- hw/i386/acpi-common.c | 5 ++--- hw/i386/acpi-microvm.c | 3 +-- hw/i386/generic_event_device_x86.c | 9 --------- hw/isa/lpc_ich9.c | 1 - 12 files changed, 19 insertions(+), 41 deletions(-) diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h index a68825acf5..968d625d88 100644 --- a/hw/i386/acpi-common.h +++ b/hw/i386/acpi-common.h @@ -1,15 +1,18 @@ #ifndef HW_I386_ACPI_COMMON_H #define HW_I386_ACPI_COMMON_H -#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/i386/x86.h" +#include "hw/boards.h" /* Default IOAPIC ID */ #define ACPI_BUILD_IOAPIC_ID 0x0 +void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids, GArray *entry, + bool force_enabled); + void acpi_build_madt(GArray *table_data, BIOSLinker *linker, - X86MachineState *x86ms, AcpiDeviceIf *adev, + X86MachineState *x86ms, const char *oem_id, const char *oem_table_id); #endif diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h index a1648220ff..ca92928124 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -52,7 +52,5 @@ struct AcpiDeviceIfClass { /* */ void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); void (*send_event)(AcpiDeviceIf *adev, AcpiEventStatusBits ev); - void (*madt_cpu)(int uid, const CPUArchIdList *apic_ids, GArray *entry, - bool force_enabled); }; #endif diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 999caaf510..25b25bb594 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -15,6 +15,7 @@ #include "hw/qdev-core.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" +#include "hw/boards.h" #include "hw/hotplug.h" typedef struct AcpiCpuStatus { @@ -55,8 +56,11 @@ typedef struct CPUHotplugFeatures { const char *smi_path; } CPUHotplugFeatures; +typedef void (*madt_cpu_fn)(int uid, const CPUArchIdList *apic_ids, + GArray *entry, bool force_enabled); + void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, - hwaddr io_base, + hwaddr io_base, madt_cpu_fn madt_cpu, const char *res_root, const char *event_handler_method); diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index a0647165d1..a5cce88653 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -191,10 +191,6 @@ bool pc_system_ovmf_table_find(const char *entry, uint8_t **data, int *data_len); void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size); -/* hw/i386/acpi-common.c */ -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 d0d399d26b..9662a594ad 100644 --- a/hw/acpi/acpi-x86-stub.c +++ b/hw/acpi/acpi-x86-stub.c @@ -1,12 +1,6 @@ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/i386/acpi-build.h" -void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids, - GArray *entry, bool force_enabled) -{ -} - Object *acpi_get_i386_pci_host(void) { return NULL; diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 19c154d78f..db15f9278d 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -338,7 +338,7 @@ const VMStateDescription vmstate_cpu_hotplug = { #define CPU_FW_EJECT_EVENT "CEJF" void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, - hwaddr io_base, + hwaddr io_base, madt_cpu_fn madt_cpu, const char *res_root, const char *event_handler_method) { @@ -353,8 +353,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, MachineClass *mc = MACHINE_GET_CLASS(machine); const CPUArchIdList *arch_ids = mc->possible_cpu_arch_ids(machine); 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); + + assert(madt_cpu); cpu_ctrl_dev = aml_device("%s", cphp_res_path); { @@ -664,9 +664,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, aml_append(dev, method); /* build _MAT object */ - assert(adevc && adevc->madt_cpu); - adevc->madt_cpu(i, arch_ids, madt_buf, - true); /* set enabled flag */ + 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))); g_array_free(madt_buf, true); diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 0a81f1ad93..4d0d4fdeeb 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -20,7 +20,6 @@ */ #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/isa/apm.h" @@ -643,7 +642,6 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data) hc->unplug = piix4_device_unplug_cb; adevc->ospm_status = piix4_ospm_status; adevc->send_event = piix4_send_gpe; - adevc->madt_cpu = pc_madt_cpu_entry; } static const TypeInfo piix4_pm_info = { diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 127c4e2d50..0be3960a37 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1440,7 +1440,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, .fw_unplugs_cpu = pm->smi_on_cpu_unplug, }; build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, - "\\_SB.PCI0", "\\_GPE._E02"); + pc_madt_cpu_entry, "\\_SB.PCI0", "\\_GPE._E02"); } if (pcms->memhp_io_base && nr_mem) { @@ -2424,8 +2424,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) acpi_add_table(table_offsets, tables_blob); acpi_build_madt(tables_blob, tables->linker, x86ms, - ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, - x86ms->oem_table_id); + x86ms->oem_id, x86ms->oem_table_id); #ifdef CONFIG_ACPI_ERST { diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 52e5c1439a..aabf78092e 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -94,14 +94,13 @@ build_xrupt_override(GArray *entry, uint8_t src, uint32_t gsi, uint16_t flags) * 5.2.8 Multiple APIC Description Table */ void acpi_build_madt(GArray *table_data, BIOSLinker *linker, - X86MachineState *x86ms, AcpiDeviceIf *adev, + X86MachineState *x86ms, const char *oem_id, const char *oem_table_id) { int i; bool x2apic_mode = false; MachineClass *mc = MACHINE_GET_CLASS(x86ms); const CPUArchIdList *apic_ids = mc->possible_cpu_arch_ids(MACHINE(x86ms)); - AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(adev); AcpiTable table = { .sig = "APIC", .rev = 1, .oem_id = oem_id, .oem_table_id = oem_table_id }; @@ -111,7 +110,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(i, apic_ids, table_data, false); + pc_madt_cpu_entry(i, apic_ids, table_data, false); if (apic_ids->cpus[i].arch_id > 254) { x2apic_mode = true; } diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index fb09185cbd..d8a444d06c 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -213,8 +213,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables, acpi_add_table(table_offsets, tables_blob); acpi_build_madt(tables_blob, tables->linker, X86_MACHINE(machine), - ACPI_DEVICE_IF(x86ms->acpi_dev), x86ms->oem_id, - x86ms->oem_table_id); + x86ms->oem_id, x86ms->oem_table_id); #ifdef CONFIG_ACPI_ERST { diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_device_x86.c index e26fb02a2e..8fc233e1f1 100644 --- a/hw/i386/generic_event_device_x86.c +++ b/hw/i386/generic_event_device_x86.c @@ -8,19 +8,10 @@ #include "qemu/osdep.h" #include "hw/acpi/generic_event_device.h" -#include "hw/i386/pc.h" - -static void acpi_ged_x86_class_init(ObjectClass *class, void *data) -{ - AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(class); - - adevc->madt_cpu = pc_madt_cpu_entry; -} static const TypeInfo acpi_ged_x86_info = { .name = TYPE_ACPI_GED_X86, .parent = TYPE_ACPI_GED, - .class_init = acpi_ged_x86_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 8d541e2b54..0ab0a341be 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -870,7 +870,6 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data) hc->unplug = ich9_pm_device_unplug_cb; adevc->ospm_status = ich9_pm_ospm_status; adevc->send_event = ich9_send_gpe; - adevc->madt_cpu = pc_madt_cpu_entry; amldevc->build_dev_aml = build_ich9_isa_aml; } From patchwork Mon Jan 16 15:29:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD67DC46467 for ; Mon, 16 Jan 2023 15:31:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQg-0001HK-Fw; Mon, 16 Jan 2023 10:29:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQe-0001GV-OZ; Mon, 16 Jan 2023 10:29:44 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQc-00086l-Nv; Mon, 16 Jan 2023 10:29:44 -0500 Received: by mail-ej1-x630.google.com with SMTP id v6so25908363ejg.6; Mon, 16 Jan 2023 07:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mn7/sU+mJfr3T8mTQw8ks77RVyjE2mSYXhGvMHZOqAQ=; b=BVcWA/nWBRUylsQS1tnSL0Yv8kdBJhhU3MOjBKw/tJSGH0PDoS7nImubVrleYPsc7I vFZ1m5VzV1Ngp/JJidY3ZsDEMcMUurDOHsq64qRk2PncvrkxW5aV1FJji2Y2DYZtekTf sqouZ+aU9O8OWK4TN0L0hXTiWtAyidQGbIg6BRD9rgec5qn7AGfEkfp/q62wFN8dI2Uv +tulGb7IBtO/2ghWJr87o5khaKzNJHHY9bT3eeetnB6M3Rc+XYZ2sYea13cxnchZlr95 smTX2KGaZMZCNMXNDIZb5L8g3AHYUHL83/gSAMq0+qfVELVrOzL12ykwePCuxcCFkNPz SvOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mn7/sU+mJfr3T8mTQw8ks77RVyjE2mSYXhGvMHZOqAQ=; b=62VVBojN1kVlR9jTpukD4Ph/bSdICKDooNc4YcTHee3wObMLSPpaeSEEgSQSihh1rP tNn9Yl9tiMJlPhXxvd48Aqtcqy6YWLTee34zuNlXZnCFa76qcRd+dvj3UA0MtFgDvAu8 mHqSGs7nxtXJ5en9OltmwsI+BUAePV4d0FtOyt4UWIWTpxWKo7Jg7MhQMfkPCTpPgC34 U2LVuVk3fKOuJarg2Z3qZP2HaEPCUwgVSDe7TTafTF2UnPB4SRDJ/RRwjXRdlIinXC1Y FPZMkqWWUunU1D4Rtc8h61vs0xB/q1Bhlw6EdESWCbAuwwu2IeguERwa7fDXlNeOETHX AIVQ== X-Gm-Message-State: AFqh2krH0NvzNXAffHf8RiRbvg3NCD4IJjuasUGXbvUcp4HJfYl0FDjk 7nJ0s4aAcKvKVXnDaMY7eNEZIk4iL4k= X-Google-Smtp-Source: AMrXdXucuKU9T1EG0zEyDCYc9EPlDMz+tbDlD/YIxb5DN0HsZmUWNOabaPTfwqAIrPbiOkUM5MaKXg== X-Received: by 2002:a17:907:8196:b0:7c1:6fd3:1efa with SMTP id iy22-20020a170907819600b007c16fd31efamr11315693ejc.28.1673882980854; Mon, 16 Jan 2023 07:29:40 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:40 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 3/7] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Date: Mon, 16 Jan 2023 16:29:04 +0100 Message-Id: <20230116152908.147275-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Removing the "hw/boards.h" include from hw/acpi/acpi_dev_interface.h requires include fixes in various unrelated files to keep the code compiling. Signed-off-by: Bernhard Beschow --- hw/acpi/hmat.h | 3 ++- include/hw/acpi/acpi_dev_interface.h | 1 - hw/acpi/cpu.c | 1 + hw/acpi/hmat.c | 1 + hw/acpi/memory_hotplug.c | 1 + monitor/qmp-cmds.c | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/acpi/hmat.h b/hw/acpi/hmat.h index b57f0e7e80..fd989cb661 100644 --- a/hw/acpi/hmat.h +++ b/hw/acpi/hmat.h @@ -27,7 +27,8 @@ #ifndef HMAT_H #define HMAT_H -#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "sysemu/numa.h" /* * ACPI 6.3: 5.2.27.3 Memory Proximity Domain Attributes Structure, diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h index ca92928124..68d9d15f50 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -3,7 +3,6 @@ #include "qapi/qapi-types-acpi.h" #include "qom/object.h" -#include "hw/boards.h" #include "hw/qdev-core.h" /* These values are part of guest ABI, and can not be changed */ diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index db15f9278d..bc77c00d66 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "migration/vmstate.h" #include "hw/acpi/cpu.h" +#include "hw/core/cpu.h" #include "qapi/error.h" #include "qapi/qapi-events-acpi.h" #include "trace.h" diff --git a/hw/acpi/hmat.c b/hw/acpi/hmat.c index 3a6d51282a..d9de0daf89 100644 --- a/hw/acpi/hmat.c +++ b/hw/acpi/hmat.c @@ -27,6 +27,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "sysemu/numa.h" +#include "hw/acpi/aml-build.h" #include "hw/acpi/hmat.h" /* diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index d926f4f77d..0b883df813 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "hw/acpi/memory_hotplug.h" #include "hw/mem/pc-dimm.h" +#include "hw/boards.h" #include "hw/qdev-core.h" #include "migration/vmstate.h" #include "trace.h" diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 2932b3f3a5..45b0f2905d 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -44,6 +44,7 @@ #include "hw/acpi/acpi_dev_interface.h" #include "hw/intc/intc.h" #include "hw/rdma/rdma.h" +#include "hw/boards.h" #include "monitor/stats.h" NameInfo *qmp_query_name(Error **errp) From patchwork Mon Jan 16 15:29:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3191DC46467 for ; Mon, 16 Jan 2023 15:31:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQi-0001I5-FN; Mon, 16 Jan 2023 10:29:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQg-0001HT-Qj; Mon, 16 Jan 2023 10:29:46 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQf-00086L-D8; Mon, 16 Jan 2023 10:29:46 -0500 Received: by mail-ej1-x62d.google.com with SMTP id v6so25908714ejg.6; Mon, 16 Jan 2023 07:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9a8gxi5rLrFM0u1gWl0+pJ4V2EIK6saTEJaB/8a6FCo=; b=RE+YI4Mi3MexspdW8815dwK0NOKHjLaIoKYjDRwUFu0DuIgaX9SAJ9n6IDKddt3YuO FdgDYp3ge6W3R2nlKOfptO7HTYMme2oW30vKMFlIjvngWjMlDm88myaGfveQG1pFpxq0 CBXWEMlNCWLQLrkj7ipbmEg/APF+ggCSOa9Zx9F76Udh9xiaOXvxrqnG3IUJU9zQXX8Z XqpkVtdtFO4KzNdHFpRpwoa8Uv7ghkiwXsB4VKLdk1gtXJu7FXMfo0hgp2M3I/74i9J1 sutT45zZWP4YvGIh4xJuND4OkUozObOGa6PqSQKuXwuCH2NyBgbSJvoGPbXl0Cw+jd5k Ui9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9a8gxi5rLrFM0u1gWl0+pJ4V2EIK6saTEJaB/8a6FCo=; b=YZbakwo0LxZOv8IPdqQGfV1OhXJyHWopVasCkIkiZV4ICE3IwPIsLxE1JNiGCvJdE8 Y0yAe92dUVwOw0lUqGZvgnZGEzdgdyHglRGwJXsAsCYjvybL+Vedrah19KyWmhBVUTc5 PgV3ggtj+ngV1cjhp5hFbs6KfFhKMIKwGZJ9j0CCd6utofIskdxFNgv5BZVoptqHf9B2 YO8Af3Vak7ajoVaY9Zo15RlIsZC/bduKSY7mibCox0cmBu3LNbwvvv+H1kShiGR2+gBu m9P3pIdk59vdfwNjpTI7eWl43EU9AAn8NCPzWMF6uhclnXoWTGhsFfnaIcWAhVvTNNCs dtAg== X-Gm-Message-State: AFqh2koDx0wpWhylYbSnFLn7QdA59c54v4H1C1fOrO07JjPNkmHnNvWG YD4xR55h0tLpuz+LmqpiOGQhnLwjcXI= X-Google-Smtp-Source: AMrXdXtAmU+znPoOZnTwE72mT27l1jVbGNWeUJGDyMC/hzdMePr6L2gvYFIiewnYOB9gj6bd6ldP1A== X-Received: by 2002:a17:907:8d17:b0:7c1:1ada:5e1e with SMTP id tc23-20020a1709078d1700b007c11ada5e1emr78502287ejc.26.1673882984198; Mon, 16 Jan 2023 07:29:44 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:43 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 4/7] hw/acpi/piix4: No need to #include "hw/southbridge/piix.h" Date: Mon, 16 Jan 2023 16:29:05 +0100 Message-Id: <20230116152908.147275-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org hw/acpi/piix4 has its own header with its structure definition etc. Ammends commit 2bfd0845f0 'hw/acpi/piix4: move PIIX4PMState into separate piix4.h header'. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/acpi/piix4.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 4d0d4fdeeb..2e19a55526 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -20,7 +20,6 @@ */ #include "qemu/osdep.h" -#include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/i2c/pm_smbus.h" From patchwork Mon Jan 16 15:29:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34242C677F1 for ; Mon, 16 Jan 2023 15:30:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQk-0001It-DG; Mon, 16 Jan 2023 10:29:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQj-0001IF-5K; Mon, 16 Jan 2023 10:29:49 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQh-00087d-Mc; Mon, 16 Jan 2023 10:29:48 -0500 Received: by mail-ej1-x62b.google.com with SMTP id vm8so68897876ejc.2; Mon, 16 Jan 2023 07:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FIPjagYbHti5a3V5WvuYNbsfsB1fpcKo6VchvNPRZ9g=; b=oALwzM/rlliqPOy8fY0/GlsOhh9VHFdvI//D/exPl8NZY294gjhWdsAmdD/gjgoygV xCpprNnQZLnRqJ0PcvSyrO+fzxgQJpwoqhSQ+qyh8fwO7/OfoT4wCUlCD+u68GDu8i5T K/897mogDwSdcQY+KSpSEyKvhE0l0bon6rJ1BnKlkXG1tHRwoYMd0A7ZynP02YHNNY+z vFMmLOnt/LdKVlPgLOhvY40D8X2CwX3y66TSpRxFs3Q5AZInJF1Rx65irxmK48JMk7Kw IiWrTbXuiZHNTf6yYIrIgwHF7INT5kW0NEXdn3MXpFpY8QxD+VhNhE7dFK/3rQD8VB6Y pfTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FIPjagYbHti5a3V5WvuYNbsfsB1fpcKo6VchvNPRZ9g=; b=RqqRakW22D6VLVZUlARcdUvmTh9CgfLI7VuFmWvn3tGIPfFav48bAy7JSkk1W8RG0d kUSwHQadMZR7uZHc9YYy6Jp10kozSVS6YiSz//Ji4LtMgxxp57AJ7vMyQlQhxbHG5oIF CBUBz4KjJhgRsXwwdfBtseaX8pPYMToH0UL+5qZfS4v8yzWbQEpjAKY+V0ma0yqeMN8J dZlkKIE+Dyq4+IUFXFFBoxMh9AQu4/WUycRWnfSIiacSPVFH5ngCQ6CW4AfBjuu1Ni63 giZum3DkaY1eITzO77KpnOk16yof0azoaDvgGnGRYJAQVV194DnRGHG+mtdecE3Zhgi5 SyXg== X-Gm-Message-State: AFqh2ko5Aux3jBcleJqj5Cu4Mh1xphmaE/SiPlYnyUNC2DrZmV8oQOrM gRY0OEk8GTtAi3YFuyG7y7EpqB+92Cg= X-Google-Smtp-Source: AMrXdXvc67m4Lu7c227a7ijWxNryEu2SFp7scGnRqPSBfSJB5aeIA2GubGfw6gf/Wc8DsZRd5J2uAw== X-Received: by 2002:a17:907:7844:b0:7c0:eba2:f9dd with SMTP id lb4-20020a170907784400b007c0eba2f9ddmr75656304ejc.53.1673882985831; Mon, 16 Jan 2023 07:29:45 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:45 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 5/7] hw/i386/acpi-build: Remove unused attributes Date: Mon, 16 Jan 2023 16:29:06 +0100 Message-Id: <20230116152908.147275-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Ammends commit 3db119da7915 'pc: acpi: switch to AML API composed DSDT'. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 0be3960a37..428328dc2d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -117,8 +117,6 @@ typedef struct AcpiMiscInfo { #ifdef CONFIG_TPM TPMVersion tpm_version; #endif - const unsigned char *dsdt_code; - unsigned dsdt_size; } AcpiMiscInfo; typedef struct FwCfgTPMConfig { From patchwork Mon Jan 16 15:29:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1456CC46467 for ; Mon, 16 Jan 2023 15:32:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQl-0001Jv-QV; Mon, 16 Jan 2023 10:29:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQk-0001Ir-8W; Mon, 16 Jan 2023 10:29:50 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQi-00086W-Kv; Mon, 16 Jan 2023 10:29:50 -0500 Received: by mail-ej1-x631.google.com with SMTP id kt14so10023720ejc.3; Mon, 16 Jan 2023 07:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0LyHCLycQ/SrUG8WLZEXiUnOm83Y3IxqhjP2L2hOFIg=; b=o6OEBQGh76Blf1OSvymyC/ESxDHopZv02/xco7ZwRrggnhq6ima+ITMDknaBFWGy9N WeJrSIvRyzm6LVZALeKNsIT4KGmHgfuU1A/Xl0OcvOcMcxxo4jE/sJ6n/I5ulziocAvI gRevrt/aDt7FAECVI9JJMG8qhaG9ksyHo9q6FgJziil6H1oZH/OhZO9tdGr3K7yChOd9 qZLQedY9KA5b4DC//r2tx9Ncl/yrL9tsg4cTgImmA56TK7b4pQ0OxXhj6v5oYM0zz7sy 4tD/nr/tulMI/BpeEBWMBgs04LUY73t/OuA/+XwpUuK2M0UBb/YOJ6/FBVPYznGvqvIh RaGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0LyHCLycQ/SrUG8WLZEXiUnOm83Y3IxqhjP2L2hOFIg=; b=nbPcQTM2UMf3LuXQPMG8wcCDFEaXQNL0nZQ39VALtNV9P/CP8JACRyfyyMyX3su2+t sN52l7bvvoHCV/7TcAZSDA4r1DxffU3TOimBRuM2IoNxB27GMlPI/SCHNXrhgoaC5iGV CBuYfQNXarPGfoalBwfCc6ciHUwF2V8/PIvuQNA2OT/BM2Zo8bMwn9FiGe9rtZY+Qjz7 5gPP6n3XqwQwUZQog8pSEBpBMKURfEmTgXtD6PLEKar4mLXNDweyM4cvKy+nj8NLl4n4 YeqPCg10skSg3S22dC+P3MG57fhXszs2LvOe0OIkED95nT6HOze34HWoc5Jpq9QpXeNY 5kTw== X-Gm-Message-State: AFqh2kohbbq4DgOQIk4quv0xz0zJLGPXSFKwu39AB7uWnBxsPzt7B88Q Mo4PYEpCLCztsQ3ICRRHi8uhLBRjBbw= X-Google-Smtp-Source: AMrXdXt3N6CKJFemKejbDkqhXXM+C5oXWovnr8GE9TqmGDResUXDnKfRIw8pUT8hEfwBgLh+xU1rUA== X-Received: by 2002:a17:906:1419:b0:84c:9016:79ae with SMTP id p25-20020a170906141900b0084c901679aemr52851395ejc.53.1673882987397; Mon, 16 Jan 2023 07:29:47 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 6/7] hw/isa/isa-bus: Turn isa_build_aml() into qbus_build_aml() Date: Mon, 16 Jan 2023 16:29:07 +0100 Message-Id: <20230116152908.147275-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Frees isa-bus.c from implicit ACPI dependency. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- include/hw/acpi/acpi_aml_interface.h | 3 +++ include/hw/isa/isa.h | 1 - hw/acpi/acpi_interface.c | 10 ++++++++++ hw/i386/acpi-microvm.c | 3 ++- hw/isa/isa-bus.c | 10 ---------- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/hw/acpi/acpi_aml_interface.h b/include/hw/acpi/acpi_aml_interface.h index 436da069d6..11748a8866 100644 --- a/include/hw/acpi/acpi_aml_interface.h +++ b/include/hw/acpi/acpi_aml_interface.h @@ -3,6 +3,7 @@ #include "qom/object.h" #include "hw/acpi/aml-build.h" +#include "hw/qdev-core.h" #define TYPE_ACPI_DEV_AML_IF "acpi-dev-aml-interface" typedef struct AcpiDevAmlIfClass AcpiDevAmlIfClass; @@ -46,4 +47,6 @@ static inline void call_dev_aml_func(DeviceState *dev, Aml *scope) } } +void qbus_build_aml(BusState *bus, Aml *scope); + #endif diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 6c8a8a92cb..25acd5c34c 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -86,7 +86,6 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp); ISADevice *isa_create_simple(ISABus *bus, const char *name); ISADevice *isa_vga_init(ISABus *bus); -void isa_build_aml(ISABus *bus, Aml *scope); /** * isa_register_ioport: Install an I/O port region on the ISA bus. diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c index c668d361f6..8637ff18fc 100644 --- a/hw/acpi/acpi_interface.c +++ b/hw/acpi/acpi_interface.c @@ -2,6 +2,7 @@ #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" +#include "qemu/queue.h" void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event) { @@ -12,6 +13,15 @@ void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event) } } +void qbus_build_aml(BusState *bus, Aml *scope) +{ + BusChild *kid; + + QTAILQ_FOREACH(kid, &bus->children, sibling) { + call_dev_aml_func(DEVICE(kid->child), scope); + } +} + static void register_types(void) { static const TypeInfo acpi_dev_if_info = { diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index d8a444d06c..fec22d85c1 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -26,6 +26,7 @@ #include "exec/memory.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/acpi/generic_event_device.h" @@ -129,7 +130,7 @@ build_dsdt_microvm(GArray *table_data, BIOSLinker *linker, sb_scope = aml_scope("_SB"); fw_cfg_add_acpi_dsdt(sb_scope, x86ms->fw_cfg); - isa_build_aml(ISA_BUS(isabus), sb_scope); + qbus_build_aml(BUS(isabus), sb_scope); build_ged_aml(sb_scope, GED_DEVICE, x86ms->acpi_dev, GED_MMIO_IRQ, AML_SYSTEM_MEMORY, GED_MMIO_BASE); acpi_dsdt_add_power_button(sb_scope); diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 1bee1a47f1..f155b80010 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -24,7 +24,6 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" -#include "hw/acpi/acpi_aml_interface.h" static ISABus *isabus; @@ -188,15 +187,6 @@ ISADevice *isa_vga_init(ISABus *bus) } } -void isa_build_aml(ISABus *bus, Aml *scope) -{ - BusChild *kid; - - QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } -} - static void isabus_bridge_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); From patchwork Mon Jan 16 15:29:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13103406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CB9EC54EBE for ; Mon, 16 Jan 2023 15:31:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHRQn-0001KQ-BW; Mon, 16 Jan 2023 10:29:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHRQm-0001KD-NU; Mon, 16 Jan 2023 10:29:52 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHRQl-00088B-2x; Mon, 16 Jan 2023 10:29:52 -0500 Received: by mail-ej1-x636.google.com with SMTP id qx13so10547778ejb.13; Mon, 16 Jan 2023 07:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5s77MYq/Ag1sBiM8HXH3NbAmPKNbAbFrUF5peJzEPa8=; b=er288XyiAzUAQ0VxASV8hP+wlOO5jgpGMa7NNHNmSLv7fxrf2eBbNUil2CsH+pjrvm 6R7ZVxsR05kxCpmUfLHNQnkgmr63Dmy6m7DT20U3PEwgM/HhOwevyaIVJag7/7UsXbxr EFXdGEBQx/w3xpA4F2h4bNsWKOjA/xt+4FaJsPaGPkcLJt37ZOz1YeeJsH8HJYOLCGOH gbSUKDtgrNHJK/CPJYcUd5u7erdPXBstmVP30zju98bJ4Be8EIGT36mS01772HoC1x4T hbVkmT28d0ZP9MI8AV6WtYqH28+U0PbNeOHHbmxMxqEB1e7+PuVNzC9NTEknJw7mnsrC IcoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5s77MYq/Ag1sBiM8HXH3NbAmPKNbAbFrUF5peJzEPa8=; b=mcufHT1DQQaZZiONFG79uCd5HIk31yjwwTKPsecHdY6QEQ2FMiSAFlBDDjd7nB5Bj9 NubqOCYbzu2daSbQBb8pHviDOk+Lb5gCqMjw7q1NuRGPtk8Don785NX7JZEcTSHTje7l CI9s4X6WrjePnLLr9X60ie+5ApXUdWJnw+gUOxpoXKoUrhnK9eYfw7jmKRYehWOUAob2 mL2j8AanJsvKwjUhES/rnZiB1IN/fuF32Z5lvknF0ia2ZTXKN470oAD3M5ijsVcoiJvk +s4JEeDNvzmbJSbVJYIFJm0cmvohkxKn8v9HF5pxspbYADCuwdDylgoIDCfHAOsGSl1H ExTA== X-Gm-Message-State: AFqh2ko2Z+BR9ITHuhsqILfUynkp6+MT/llebwbUrI5mIltGMiV3fwh2 S4M1FVWhXHMKWviOsJ0pZJjKLMjTZ8Q= X-Google-Smtp-Source: AMrXdXsTow+wpFAT5RV87k/7a1FbmA9vvAWKNuJ0qJhMLsC8SSJgotggLzcGPkj7/vVAMNvK9+AGnw== X-Received: by 2002:a17:907:c786:b0:7ad:a797:5bb9 with SMTP id tz6-20020a170907c78600b007ada7975bb9mr105736287ejc.29.1673882989141; Mon, 16 Jan 2023 07:29:49 -0800 (PST) Received: from localhost.localdomain (dynamic-077-191-143-217.77.191.pool.telefonica.de. [77.191.143.217]) by smtp.gmail.com with ESMTPSA id x3-20020a170906b08300b007c0688a68cbsm12180764ejy.176.2023.01.16.07.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 07:29:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Richard Henderson , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Markus Armbruster , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Marcel Apfelbaum , Igor Mammedov , Aurelien Jarno , Bernhard Beschow Subject: [PATCH v3 7/7] piix3, ich9: Reuse qbus_build_aml() Date: Mon, 16 Jan 2023 16:29:08 +0100 Message-Id: <20230116152908.147275-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116152908.147275-1-shentey@gmail.com> References: <20230116152908.147275-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- hw/i2c/smbus_ich9.c | 5 +---- hw/isa/lpc_ich9.c | 5 +---- hw/isa/piix3.c | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index ee50ba1f2c..52ba77f3fc 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -97,13 +97,10 @@ static void ich9_smbus_realize(PCIDevice *d, Error **errp) static void build_ich9_smb_aml(AcpiDevAmlIf *adev, Aml *scope) { - BusChild *kid; ICH9SMBState *s = ICH9_SMB_DEVICE(adev); BusState *bus = BUS(s->smb.smbus); - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } static void ich9_smb_class_init(ObjectClass *klass, void *data) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 0ab0a341be..d5d4b0f177 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -813,7 +813,6 @@ static void ich9_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; - BusChild *kid; ICH9LPCState *s = ICH9_LPC_DEVICE(adev); BusState *bus = BUS(s->isa_bus); Aml *sb_scope = aml_scope("\\_SB"); @@ -835,9 +834,7 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) aml_append(sb_scope, field); aml_append(scope, sb_scope); - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } static void ich9_lpc_class_init(ObjectClass *klass, void *data) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 283b971ec4..a9cb39bf21 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -306,7 +306,6 @@ static void pci_piix3_realize(PCIDevice *dev, Error **errp) static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; - BusChild *kid; Aml *sb_scope = aml_scope("\\_SB"); BusState *bus = qdev_get_child_bus(DEVICE(adev), "isa.0"); @@ -322,9 +321,7 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope) aml_append(sb_scope, field); aml_append(scope, sb_scope); - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } static void pci_piix3_class_init(ObjectClass *klass, void *data)