From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314538; cv=none; d=zohomail.com; s=zohoarc; b=mr0IagcvhJ2mff9GHsQ/fwlU686XxqzVGiSHt+v3L5+7N03mXvf2u2toZuvdbl98rhqE5R3mG8N+GvIh/GayMEszkwOjJg4hiqYlEwHQsNgAsIS5ILoiGea9DqnFeFkXMK8To5duUl2hp/6MV3MZuGgEdkBv3VnxkXmVpDY7W8k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314538; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e+IlR0N13hXD5WjeVdS0Wm7n5FtF6VTAAQGcvRRrtGc=; b=ftKb2KPHWZCwYI0tlZKIadG5zGpjOCFE3GjbhM1yoyAhX6kqYgtQzWYPcWnTMqkTrMrXZtArgq68EC+WtHYr5S9dqq82V6acH9vzpmE7+u5JbsBwEbD9K48/fAuut2vl4KGEAE+sqoMEu2tDtu8Ym+otH2oNnDywJZ4BwK9OZfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314538410686.9614042288771; Sat, 21 Jan 2023 07:22:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFex-00022q-Dh; Sat, 21 Jan 2023 10:19:59 -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 1pJFev-00022K-SG; Sat, 21 Jan 2023 10:19:57 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFeu-0005ep-EM; Sat, 21 Jan 2023 10:19:57 -0500 Received: by mail-ej1-x62e.google.com with SMTP id v6so20785690ejg.6; Sat, 21 Jan 2023 07:19:55 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:54 -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=e+IlR0N13hXD5WjeVdS0Wm7n5FtF6VTAAQGcvRRrtGc=; b=f872WOrCop+PJIvwlufjzhoP5GFV/V8wLnRHjsSbMi5RQJOx0CmVbBo0xyseq8r9kO KgxKp4gn9/kS+1wvhdzUBrg/M59f/tPRjZQtrYL0UvLX1vB7k1GtapGdOZRD6FFJjBwg 9JS4Qsg1QcbVD4Tfmkz7lh10FOxqHv1SCI2zi8AsBAE65LTnN70mwZ+u12f170OJt94Y 6zaoTGAfsr1fbuNiKXWRrWLtFSuD69BDohUlQwcX6yatvxvgXAMDsb7ANejIpcY5xYos TJh3O9ylWspb/xgL9skzVDZUAtw/CZ3ZFdef7px/nbhxpUecN7Uq2kKvya7D7UONW3/x nQjw== 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=e+IlR0N13hXD5WjeVdS0Wm7n5FtF6VTAAQGcvRRrtGc=; b=knsMhDPuEKgrirWXMXaBGN2nJFB9x1JkQPMqihIMZA3Nak34oP2CZI0kn4jWUam3Lg THEJbItYXHMBhCImH4ofceOBKk+fb7gDbMO6/8fIHEP1EHqGGNiGRwCsTOeZYfTRYOdN QFreHDUJoxMrSeEltSoSk5R+pPy5Y3x2S7FjSwZUNaBX/oSY5s0Fz429BQvKQiU8+iEh 4ihxGpbz39cxULXQUy8Z3KRSlO5LZ+bDMZeMqqnV3dzc5B2OxS59HrVCoYrnTEPoldtH yxDHEnevRl720qK8sRpZsFdnigIyM5rTGGFbFC9ChPc57tI1mTIddEpiLZU3IrgIbMV8 pSJg== X-Gm-Message-State: AFqh2krsUMN8zCAoTfnMIknCOuLvolI5mXTdMn/azdFpLvMeNGaQnlcL lgVL80uOf5qIq25gsyQz4PMa7D/SlDWNUQ== X-Google-Smtp-Source: AMrXdXvHsBP9t3hftC/jXuRRqWyhkVitVnvOyAUbsxwkWzkiKbJC2WPYe3d+EHcJuYNS430RCDBpOg== X-Received: by 2002:a17:906:80d8:b0:871:e9a0:ebab with SMTP id a24-20020a17090680d800b00871e9a0ebabmr19110212ejx.31.1674314394610; Sat, 21 Jan 2023 07:19:54 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 1/7] hw/i386/acpi-build: Remove unused attributes Date: Sat, 21 Jan 2023 16:19:35 +0100 Message-Id: <20230121151941.24120-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314539885100003 Ammends commit 3db119da7915 'pc: acpi: switch to AML API composed DSDT'. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 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 127c4e2d50..8c333973f9 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; =20 typedef struct FwCfgTPMConfig { --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314467; cv=none; d=zohomail.com; s=zohoarc; b=U9VOVrZjvQR09/2bqqworYb7SVc48cqFGEbLVoMuV05/uw1jAHXnwESJn1mmHTfC62kcV3960sMx7L1ciGVcTR6Zl0bKac26ikmqD7yCu5TsAg57KQ+K2flnGABME1XHKGwNxOKWx/LikR9CCGn5e4jGWLEmAnmzI3zbD1qFqVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314467; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jF2YbH83rQHIAsKAnE6+qCRm8caF9fDfl5YrEUOpfs8=; b=B8Vz9WJshK6b8Nxv+H+FcYihOwvg/OVGmebbiIcwppAa+JZD73OMUkrPXQpCfqyCtTfloGb697+5J38+k3mOJ9/C9PnbAfODO/2McW/Bk6EgXRNwDcDmSfxKoQNhZ8ueOzGebSfmaw+EKrPIxnIlA2Eh8uIRd7CmC78D22uU6Z8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314467853501.156851971474; Sat, 21 Jan 2023 07:21:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFey-00024l-AG; Sat, 21 Jan 2023 10:20:00 -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 1pJFex-00022i-3r; Sat, 21 Jan 2023 10:19:59 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFev-0005f2-AS; Sat, 21 Jan 2023 10:19:58 -0500 Received: by mail-ej1-x62f.google.com with SMTP id vw16so20722320ejc.12; Sat, 21 Jan 2023 07:19:56 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:55 -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=jF2YbH83rQHIAsKAnE6+qCRm8caF9fDfl5YrEUOpfs8=; b=i/ckuqdpdZMjzOhptRJaUN4A9ExKOSgR0F2RQI/85wbTZ+DqGOjP6hK+4SB9M42VhQ WTFr/p4wdRe6sJxvwmyU3uWV5GOrz3vlvfRZhezlVGKTrxOgEDV2zgWPS8Hpy5BPEjry s06SOurfXCBe8AmyPrrcHUHvdZChlGeyn1S09M4GRs0wKJA2kVKMewgPD0EhEq73XVma IfF8xWok4UGERmduUQnaK40gnkrfDoeKVzlOR7dKWi78dQFvPJ4qrENEJV1PEm36FaUO ykGtIV09cgCKAcj3LAerWpfqRTWJi3Db2No4Xt88dq+PgXYCrdW5EKy8zYrYBTezFp1K H67A== 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=jF2YbH83rQHIAsKAnE6+qCRm8caF9fDfl5YrEUOpfs8=; b=Kcyqcf7vjkIjzDVvPaQXj5J3O4mceWwC5bEUEc6/G52MYTvPQUEmNW3qZvY3eY/cWx phj64ExtkJwvuxghXUEcO4nJJcFjLX1VSIyAJq7AM5mCMidtvGdXRc807yilqOmVYpFB 0l2iU0LhSGi0uiTq4s6Zhl6CuG+SFAFXhGRYh8IBD3AC0cyyl3pVcDLxmgEuN0eSDL0s +0jlwKcLA1GycpTOl0kpAZwjp0bS888PQhDbHoMHTfAsiaZq55hpQbnkc67hIgsFdBPZ LRnwHnLenag0EL38/unv3j4JHHyySvgaiw87ouSoJQVJ7pMu2HbOSb7JlBnDW2MxdC3/ K9cA== X-Gm-Message-State: AFqh2koVbsDo5AA5xhuNw5yFgBGUmu1iroumcQXtP/bUaS98Y/h2JcoN PrI4wO3nxu6ci0po5WpsPe7xMxF/ZMBwmQ== X-Google-Smtp-Source: AMrXdXucI1XjEIQAxgdB8ffB3/UhYgFBq5P4XRONDOz7Ip8u6yUhrtyko5ATjpiy1FYUXKlYABwexw== X-Received: by 2002:a17:907:7da0:b0:871:89ac:decb with SMTP id oz32-20020a1709077da000b0087189acdecbmr26089475ejc.76.1674314395497; Sat, 21 Jan 2023 07:19:55 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 2/7] hw/isa/isa-bus: Turn isa_build_aml() into qbus_build_aml() Date: Sat, 21 Jan 2023 16:19:36 +0100 Message-Id: <20230121151941.24120-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314469479100015 Frees isa-bus.c from implicit ACPI dependency. While at it, resolve open coding of qbus_build_aml() in piix3 and ich9. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 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/i2c/smbus_ich9.c | 5 +---- hw/i386/acpi-microvm.c | 3 ++- hw/isa/isa-bus.c | 10 ---------- hw/isa/lpc_ich9.c | 5 +---- hw/isa/piix3.c | 5 +---- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/include/hw/acpi/acpi_aml_interface.h b/include/hw/acpi/acpi_am= l_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 @@ =20 #include "qom/object.h" #include "hw/acpi/aml-build.h" +#include "hw/qdev-core.h" =20 #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, Am= l *scope) } } =20 +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, E= rror **errp); ISADevice *isa_create_simple(ISABus *bus, const char *name); =20 ISADevice *isa_vga_init(ISABus *bus); -void isa_build_aml(ISABus *bus, Aml *scope); =20 /** * 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" =20 void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event) { @@ -12,6 +13,15 @@ void acpi_send_event(DeviceState *dev, AcpiEventStatusBi= ts event) } } =20 +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 =3D { 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 **er= rp) =20 static void build_ich9_smb_aml(AcpiDevAmlIf *adev, Aml *scope) { - BusChild *kid; ICH9SMBState *s =3D ICH9_SMB_DEVICE(adev); BusState *bus =3D BUS(s->smb.smbus); =20 - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } =20 static void ich9_smb_class_init(ObjectClass *klass, void *data) diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index fb09185cbd..a075360d85 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -26,6 +26,7 @@ =20 #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 *link= er, =20 sb_scope =3D 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" =20 static ISABus *isabus; =20 @@ -188,15 +187,6 @@ ISADevice *isa_vga_init(ISABus *bus) } } =20 -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 =3D DEVICE_CLASS(klass); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 8d541e2b54..1fba3c210c 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -813,7 +813,6 @@ static void ich9_send_gpe(AcpiDeviceIf *adev, AcpiEvent= StatusBits ev) static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; - BusChild *kid; ICH9LPCState *s =3D ICH9_LPC_DEVICE(adev); BusState *bus =3D BUS(s->isa_bus); Aml *sb_scope =3D 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); =20 - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } =20 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 **e= rrp) static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; - BusChild *kid; Aml *sb_scope =3D aml_scope("\\_SB"); BusState *bus =3D qdev_get_child_bus(DEVICE(adev), "isa.0"); =20 @@ -322,9 +321,7 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *= scope) aml_append(sb_scope, field); aml_append(scope, sb_scope); =20 - QTAILQ_FOREACH(kid, &bus->children, sibling) { - call_dev_aml_func(DEVICE(kid->child), scope); - } + qbus_build_aml(bus, scope); } =20 static void pci_piix3_class_init(ObjectClass *klass, void *data) --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314465; cv=none; d=zohomail.com; s=zohoarc; b=gPEajl3K9WLdOMkCuKw1NWCI3IX7NY/t04A2D2SqOBtMVCjpPlU/7qkkGh5rIkEjNLfo5VFQUWksqGPjCpzvc50DqN43tZ9VEoiBChIsLONEM7R8xbYFAEmkQbktB++CSd4Mm3l7t4rU5M/TZsisqj9ac7VR5zMycjfbfaKi+pA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314465; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pGh/aUL79s/xZIS2tYQ8sQVGJv5fWh11C/JSgX6ksuQ=; b=JR7y/KWUhcoQuCHanXV1beYFJpzbUb+bbe2hWGAZeY6TMAGhCeqkLQrXxhPyHxiXUPlh1GuBDXCmHYS3s+fWRaHCKR3kr9K70BBziH4dYrpgQWZOz1l2dPaZGMx8G880UL3wqI792tWQC0xqPfh2MU57vHQN74Pl2fObBYZgLbI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314464993981.4342357494107; Sat, 21 Jan 2023 07:21:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFez-00027h-Ta; Sat, 21 Jan 2023 10:20:01 -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 1pJFey-00023j-1s; Sat, 21 Jan 2023 10:20:00 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFew-0005f9-BW; Sat, 21 Jan 2023 10:19:59 -0500 Received: by mail-ej1-x635.google.com with SMTP id tz11so20884239ejc.0; Sat, 21 Jan 2023 07:19:57 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:56 -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=pGh/aUL79s/xZIS2tYQ8sQVGJv5fWh11C/JSgX6ksuQ=; b=BBDzZ9C2X8eEnxXKwm/9CKysyc6IwZ4zyyV9nXQ6O9gFk4a0LAY+Qcvz5WtW3l7rre f0ZbB+DA7IL1sv0edZc+xbGGB0R+6FhYkxGxgpcLAp3xYfP/YQETDqt++m0sOEni3uKp QVkrA6wgocRDzyBBu287dJ+cc50iBXjAb05KvmN2y3jjNahhAkp5J19CXbfOJTwP0WoY EadqnBeP1QPTDmQBsQoPqlw21zPZ52tBgmMqPATKhaUY7e15t70FxLJXhRL8eSKuX7f3 VaJ5El8zA32F0BZpReI91KhSz+Af6T7Qfq9mbg3ppHifUHfFSFZG4tXZxZZu+BMQ/EGP uNiQ== 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=pGh/aUL79s/xZIS2tYQ8sQVGJv5fWh11C/JSgX6ksuQ=; b=pcjP9ITpARIqi+W9cCRAdMPtqhFfB7+2GTKTFO3iIpEsOJKLju1xh83PowX+bhXtlZ tOkb7YbpQ1/hgCHHpixd68CWjKX8hpZwKeUDwBIJVTVcqEd9W1j/MWcBJXxONVOwv/6c GTcIVUali2rJEEwX6F9GKEJeqe+3zoSqoY+6LVwcaQ2AS4WnQEk/WRkKZOHm/N3UVjKf Nxb71Ybg3zSvmvGZEgz3yLQkleIbSzR0nJEXFOMJCvh39W1QW51vE8cbMP922E9N/tYp so3nvzJfKbctyHcaMLJxmGB/BjpakGyGqgbXJ3BITWxwvVKLpcrouG2b3fbh57VSF7C5 doGw== X-Gm-Message-State: AFqh2kpb5TkPDALRAXtvCDRcYjih81Gi6KZXhHs/MXkuvswrrzeFpP+h JQGepXBLMRJ95XKblDccflakb0zkyeeRnA== X-Google-Smtp-Source: AMrXdXtieB/s4Lq1QBsfU94h5EW7qyz4+FV6/CHvhWiysdnGGxfq+7+RysbXWURzlT/1M7h7hTJ4mA== X-Received: by 2002:a17:907:8c88:b0:86e:d375:1f04 with SMTP id td8-20020a1709078c8800b0086ed3751f04mr20734502ejc.30.1674314396452; Sat, 21 Jan 2023 07:19:56 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 3/7] hw/acpi/piix4: No need to #include "hw/southbridge/piix.h" Date: Sat, 21 Jan 2023 16:19:37 +0100 Message-Id: <20230121151941.24120-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=shentey@gmail.com; helo=mail-ej1-x635.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314468102100001 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=C3=A9 --- hw/acpi/piix4.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 0a81f1ad93..2ab4930f11 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -21,7 +21,6 @@ =20 #include "qemu/osdep.h" #include "hw/i386/pc.h" -#include "hw/southbridge/piix.h" #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/i2c/pm_smbus.h" --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314465; cv=none; d=zohomail.com; s=zohoarc; b=UFPhtL3mvMy+BvVJdCLCcKsW4lS9IXbdungfrliyS3yPceBp2AE/MzjQJeDPA3A2QR+oU21Gjw2ul+DB9qz6e9Av7Dq5PhQhbDQGN3D6Izf33VGRgJRWV2+bKWbYNQzGmzyZ7DoWHSQzmOZAjkfL+ZwG4ChbWuSS/mOcD8MJ4Z4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314465; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sOOGokVY46q32OBGRjm7qxWhNUmvSaTbbMhc+Q0cxVE=; b=IqTSXBxK1t/OJR/fZ7+de2YfT5rh7w0C1SlJdG486XgiioPFRKxMWQpluqtKQMMmocCCtIx71XRP5ceSmdGSknitpbLTN65aW1yglEoCHBPHXu6KYA7rcaY3UqdCxbuH+lHSvdjjB8lMUPhsGeA4DdguUkOjXyCNm26uQ1XhlRI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314465060378.47052529782604; Sat, 21 Jan 2023 07:21:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFez-00027g-Ts; Sat, 21 Jan 2023 10:20:01 -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 1pJFey-000258-CQ; Sat, 21 Jan 2023 10:20:00 -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 1pJFew-0005ej-I3; Sat, 21 Jan 2023 10:20:00 -0500 Received: by mail-ej1-x636.google.com with SMTP id u19so20743603ejm.8; Sat, 21 Jan 2023 07:19:57 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:56 -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=sOOGokVY46q32OBGRjm7qxWhNUmvSaTbbMhc+Q0cxVE=; b=pBtcZ6Y/EqQczKJojjt6PHQcZRuc29omxPfx9w/ixED19uxG9/Eg5OwJdQEyXR8ZiB 2vmA4otmIPJMnn2p/opANCNKl5Hh5JxDduPvBR2jSg0EL14tFERWe5uMeVY7MWZBFI9+ ru3My3JIKg4p5ehSb+VmPJpShy7LpWRJmRqvDdO0LJeuphVMcYol2Z8WjEan97jzspcW vrTH8iOAcDJIZe9aO2zTLZ+hc9xAMyDvcRStXBrUAtYJoolUmsmLCBOarVByd7we4a8p hPFQjbrytAfi0jkBe6aAwlJNsW5RfCn7mIVLleYPGLncDGefTN5U7UpOtGMXl97T1Q5u ygSw== 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=sOOGokVY46q32OBGRjm7qxWhNUmvSaTbbMhc+Q0cxVE=; b=58JU3AxxLcQgcGGHYPItjppbWe7veBb/ylKGLXVneaBy+bprq7wnsHObgolz8nX1DU JAp+C1KPflGjBriNnZQfG41sJtF1allKog2SYsmdwSAjWUiL4jhJ7/vOlcHbdD3nF8YG aaVWW0SlzDyjtvUwE5uVE4zUMI9n8LtJWrlaDvQTys70yYsu/ZekpKH87+EbvKPE3i9m 2wZV4ltT61qSJA2J5J5+ZWToUBiBDyLEAG2nZwf3xfPzyn9xH39pbS62DPhfTFzOnDnX fFHuFHTfrUeyUMqrTY8q4nc7ZyWQj63Rzc1yXB58HNHxKHxU20d+l85ktOtHnRc28aRF oD0w== X-Gm-Message-State: AFqh2kr5Ub/KCBjyqjl8nk9ZWzJNSLG9SrFvnBDE8otDZRyb4eZrsQHc baRWZWhJa0oFWW1C4CvQ9dMH4rLAM/A72A== X-Google-Smtp-Source: AMrXdXsvDBLGou33q0VDfjOaqDFb94Y7dAyTe6xodFJPKijf9DmZij9wMn4PJObZTWsxqQ6y+OlIMg== X-Received: by 2002:a17:906:af6e:b0:7c1:5b5e:4d78 with SMTP id os14-20020a170906af6e00b007c15b5e4d78mr15373653ejb.51.1674314397278; Sat, 21 Jan 2023 07:19:57 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 4/7] hw/acpi/acpi_dev_interface: Remove unused parameter from AcpiDeviceIfClass::madt_cpu Date: Sat, 21 Jan 2023 16:19:38 +0100 Message-Id: <20230121151941.24120-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314468755100005 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_de= v_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 88a120bc23..66e3d059ef 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" =20 -#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); =20 /* 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); =20 /* 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" =20 -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) { } =20 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 =3D g_strdup_printf("%s." CPUHP_RES_DEVICE, res_ro= ot); Object *obj =3D object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL= ); AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_GET_CLASS(obj); - AcpiDeviceIf *adev =3D ACPI_DEVICE_IF(obj); =20 cpu_ctrl_dev =3D aml_device("%s", cphp_res_path); { @@ -666,7 +665,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, =20 /* 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" =20 -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 =3D apic_ids->cpus[uid].arch_id; /* Flags =E2=80=93 Local APIC Flags */ @@ -112,7 +111,7 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *li= nker, build_append_int_noprefix(table_data, 1 /* PCAT_COMPAT */, 4); /* Flag= s */ =20 for (i =3D 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 =3D true; } --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314511; cv=none; d=zohomail.com; s=zohoarc; b=O6RzZ6mXxwdLD/2vw+zoVlXP0zFw87oEcDMaguV5Uyx1g2/vjo+c9IlCmdLYP6queoaVMGBxfvxxShnC/7JEPwlzFoT4i08HLW/mCHW2BbCD7PhiZ6Xs5bEz757ZWHXfUGC4ALRZnlFebSUcSiejKQiOrBgcZxAYheOvnubyVic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314511; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2jIeCbjm1xwNhNjpUbaUI09X3C4DGq6Rb9TXHKzV2JA=; b=Eh1YsFJupWADMCOTzO64prT8Oorth7XVCkEwC6xV57RHPCXaLeokMuLRiyVZF4qDPe/sztjS9HZ6mrvC8/QtziagSwlDjNHSkBzIt8gvVy9j0oN8c3dQTF010PRnocdsZv8kx+1332iOL2rxFYLEarRjXkXgGTO4KPUiZCG5GxQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314511416575.0240531668288; Sat, 21 Jan 2023 07:21:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFf2-0002Az-VL; Sat, 21 Jan 2023 10:20:04 -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 1pJFf0-00028W-Pj; Sat, 21 Jan 2023 10:20:02 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFey-0005fj-Gq; Sat, 21 Jan 2023 10:20:02 -0500 Received: by mail-ej1-x62a.google.com with SMTP id az20so20823647ejc.1; Sat, 21 Jan 2023 07:19:59 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:57 -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=2jIeCbjm1xwNhNjpUbaUI09X3C4DGq6Rb9TXHKzV2JA=; b=K9Tf1l4VXQmpQN6PFUYulcwtDY1ipwCfb8i1NXd36srXD3nJ+Sn0liNUEvPZTHPJfv h7YeJMsKIvAw3Vtvh/AgOXOs3NCE7Bt3qvw8uTfLWEZOUFyUAi8hrOPAwrqduOqgBLVz oxJZrQeCsyZFY/NWL0DW17KjxoCx1LySj2shRQ4h98Ky8wtVYzAxhjyRlZwmwsv4o9Qw 66EhFV8UqZGd3X0t8n8WFUNSDDYR9MZ+XOja6lBuaObM1XJYZfMGthkQc3xni2VHNPhX WG7w5KSYvLaVxC76p3Ca1YQ+cmQ6M1myVJ3j63LPa7cVo83CQPbOyzU+GY6oFL3cjLd0 AHfA== 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=2jIeCbjm1xwNhNjpUbaUI09X3C4DGq6Rb9TXHKzV2JA=; b=i9g8RfOQejojvQW9ZNk/A+pELtG/btpYVcT2T6ZhZBJVzLxoNPZDeR87epcPLBsuln cIHqvSe0D/XGYZUN04gtPIsrhJORg/srl4y8gt7/pvmgv8GIAZCF3iL+EYu/bNm6Kreg Q2+H127BvBitUxeHzaeHhq/okmhgZUV9SE2+VNVrwYyJYqgMXglGvHmY/Xx/gNqXwl3p gFG7XnPvuDoXXt0E3LXMtv4XCFbnPxmerC89vrT62L8QL9ZM1Bchf1hz7JAV0/246Gr1 s7TRM4yBo5G8+KI8fmD3pBeboPfxuE+ayA/aSomzpabQq7PqsbMGIYr2deXj4MHpK/rS u8VA== X-Gm-Message-State: AFqh2kpTt4ryiFQVq1DxzvtCqQRaPZF7Mr2ZoeAFdSnffCgy7iYSbUoK 4jHaAwWRmoJIKi1779+6eymX49rJtPI6iw== X-Google-Smtp-Source: AMrXdXvYNVKRCQQ6Qou3YeIrOO1FjBymhTwAEH3NqrW2PcDxiebOvHe2HqNJv2uVy0FwlexjStwWew== X-Received: by 2002:a17:907:8e86:b0:84d:43c3:a897 with SMTP id tx6-20020a1709078e8600b0084d43c3a897mr35550418ejc.2.1674314398334; Sat, 21 Jan 2023 07:19:58 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 5/7] hw/acpi/acpi_dev_interface: Factor out TYPE_ACPI_CPU_AML_IF Date: Sat, 21 Jan 2023 16:19:39 +0100 Message-Id: <20230121151941.24120-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=shentey@gmail.com; helo=mail-ej1-x62a.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314511804100001 Content-Type: text/plain; charset="utf-8" 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 TYPE_ACPI_CPU_IF --- hw/i386/acpi-common.h | 3 +-- include/hw/acpi/acpi_cpu_interface.h | 26 ++++++++++++++++++++++++++ include/hw/acpi/acpi_dev_interface.h | 2 -- hw/acpi/acpi_interface.c | 8 +++++++- hw/acpi/cpu.c | 11 ++++++----- hw/acpi/piix4.c | 2 -- hw/i386/acpi-build.c | 3 +-- hw/i386/acpi-common.c | 8 +++++--- hw/i386/acpi-microvm.c | 3 +-- hw/i386/generic_event_device_x86.c | 9 --------- hw/isa/lpc_ich9.c | 1 - target/i386/cpu.c | 13 +++++++++++++ 12 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 include/hw/acpi/acpi_cpu_interface.h diff --git a/hw/i386/acpi-common.h b/hw/i386/acpi-common.h index a68825acf5..b3c56ee014 100644 --- a/hw/i386/acpi-common.h +++ b/hw/i386/acpi-common.h @@ -1,7 +1,6 @@ #ifndef HW_I386_ACPI_COMMON_H #define HW_I386_ACPI_COMMON_H =20 -#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/i386/x86.h" =20 @@ -9,7 +8,7 @@ #define ACPI_BUILD_IOAPIC_ID 0x0 =20 void acpi_build_madt(GArray *table_data, BIOSLinker *linker, - X86MachineState *x86ms, AcpiDeviceIf *adev, + X86MachineState *x86ms, const char *oem_id, const char *oem_table_id); =20 #endif diff --git a/include/hw/acpi/acpi_cpu_interface.h b/include/hw/acpi/acpi_cp= u_interface.h new file mode 100644 index 0000000000..600f0b68cd --- /dev/null +++ b/include/hw/acpi/acpi_cpu_interface.h @@ -0,0 +1,26 @@ +#ifndef ACPI_CPU_INTERFACE_H +#define ACPI_CPU_INTERFACE_H + +#include "qom/object.h" +#include "hw/boards.h" +#include "hw/qdev-core.h" + +#define TYPE_ACPI_CPU_AML_IF "acpi-cpu-aml-interface" + +typedef struct AcpiCpuAmlIfClass AcpiCpuAmlIfClass; +DECLARE_CLASS_CHECKERS(AcpiCpuAmlIfClass, ACPI_CPU_AML_IF, + TYPE_ACPI_CPU_AML_IF) +#define ACPI_CPU_AML_IF(obj) \ + INTERFACE_CHECK(AcpiCpuAmlIf, (obj), TYPE_ACPI_CPU_AML_IF) + +typedef struct AcpiCpuAmlIf AcpiCpuAmlIf; + +struct AcpiCpuAmlIfClass { + /* */ + InterfaceClass parent_class; + + /* */ + void (*madt_cpu)(int uid, const CPUArchIdList *apic_ids, GArray *entry, + bool force_enabled); +}; +#endif diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_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/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c index 8637ff18fc..11a57e2154 100644 --- a/hw/acpi/acpi_interface.c +++ b/hw/acpi/acpi_interface.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "hw/acpi/acpi_cpu_interface.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" @@ -34,10 +35,15 @@ static void register_types(void) .parent =3D TYPE_INTERFACE, .class_size =3D sizeof(AcpiDevAmlIfClass), }; - + static const TypeInfo acpi_cpu_aml_if_info =3D { + .name =3D TYPE_ACPI_CPU_AML_IF, + .parent =3D TYPE_INTERFACE, + .class_size =3D sizeof(AcpiCpuAmlIfClass), + }; =20 type_register_static(&acpi_dev_if_info); type_register_static(&acpi_dev_aml_if_info); + type_register_static(&acpi_cpu_aml_if_info); } =20 type_init(register_types) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 19c154d78f..f6647e99b1 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "migration/vmstate.h" +#include "hw/acpi/acpi_cpu_interface.h" #include "hw/acpi/cpu.h" #include "qapi/error.h" #include "qapi/qapi-events-acpi.h" @@ -353,8 +354,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, MachineClass *mc =3D MACHINE_GET_CLASS(machine); const CPUArchIdList *arch_ids =3D mc->possible_cpu_arch_ids(machine); char *cphp_res_path =3D g_strdup_printf("%s." CPUHP_RES_DEVICE, res_ro= ot); - Object *obj =3D object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, NULL= ); - AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_GET_CLASS(obj); =20 cpu_ctrl_dev =3D aml_device("%s", cphp_res_path); { @@ -648,6 +647,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, for (i =3D 0; i < arch_ids->len; i++) { Aml *dev; Aml *uid =3D aml_int(i); + ObjectClass *oc =3D object_class_by_name(arch_ids->cpus[i].typ= e); + AcpiCpuAmlIfClass *acpuac =3D ACPI_CPU_AML_IF_CLASS(oc); GArray *madt_buf =3D g_array_new(0, 1, 1); int arch_id =3D arch_ids->cpus[i].arch_id; =20 @@ -664,9 +665,9 @@ void build_cpus_aml(Aml *table, MachineState *machine, = CPUHotplugFeatures opts, aml_append(dev, method); =20 /* build _MAT object */ - assert(adevc && adevc->madt_cpu); - adevc->madt_cpu(i, arch_ids, madt_buf, - true); /* set enabled flag */ + assert(acpuac && acpuac->madt_cpu); + acpuac->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 2ab4930f11..2e19a55526 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -20,7 +20,6 @@ */ =20 #include "qemu/osdep.h" -#include "hw/i386/pc.h" #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/i2c/pm_smbus.h" @@ -642,7 +641,6 @@ static void piix4_pm_class_init(ObjectClass *klass, voi= d *data) hc->unplug =3D piix4_device_unplug_cb; adevc->ospm_status =3D piix4_ospm_status; adevc->send_event =3D piix4_send_gpe; - adevc->madt_cpu =3D pc_madt_cpu_entry; } =20 static const TypeInfo piix4_pm_info =3D { diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 8c333973f9..b12a843447 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2422,8 +2422,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) =20 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); =20 #ifdef CONFIG_ACPI_ERST { diff --git a/hw/i386/acpi-common.c b/hw/i386/acpi-common.c index 52e5c1439a..0d1a2bb8aa 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -25,6 +25,7 @@ =20 #include "exec/memory.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/acpi_cpu_interface.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" #include "hw/i386/pc.h" @@ -94,14 +95,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 =3D false; MachineClass *mc =3D MACHINE_GET_CLASS(x86ms); const CPUArchIdList *apic_ids =3D mc->possible_cpu_arch_ids(MACHINE(x8= 6ms)); - AcpiDeviceIfClass *adevc =3D ACPI_DEVICE_IF_GET_CLASS(adev); AcpiTable table =3D { .sig =3D "APIC", .rev =3D 1, .oem_id =3D oem_id, .oem_table_id =3D oem_table_id }; =20 @@ -111,7 +111,9 @@ void acpi_build_madt(GArray *table_data, BIOSLinker *li= nker, build_append_int_noprefix(table_data, 1 /* PCAT_COMPAT */, 4); /* Flag= s */ =20 for (i =3D 0; i < apic_ids->len; i++) { - adevc->madt_cpu(i, apic_ids, table_data, false); + ObjectClass *oc =3D object_class_by_name(apic_ids->cpus[i].type); + AcpiCpuAmlIfClass *acpuac =3D ACPI_CPU_AML_IF_CLASS(oc); + acpuac->madt_cpu(i, apic_ids, table_data, false); if (apic_ids->cpus[i].arch_id > 254) { x2apic_mode =3D true; } diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index a075360d85..fec22d85c1 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -214,8 +214,7 @@ static void acpi_build_microvm(AcpiBuildTables *tables, =20 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); =20 #ifdef CONFIG_ACPI_ERST { diff --git a/hw/i386/generic_event_device_x86.c b/hw/i386/generic_event_dev= ice_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 @@ =20 #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 =3D ACPI_DEVICE_IF_CLASS(class); - - adevc->madt_cpu =3D pc_madt_cpu_entry; -} =20 static const TypeInfo acpi_ged_x86_info =3D { .name =3D TYPE_ACPI_GED_X86, .parent =3D TYPE_ACPI_GED, - .class_init =3D acpi_ged_x86_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 1fba3c210c..d5d4b0f177 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -867,7 +867,6 @@ static void ich9_lpc_class_init(ObjectClass *klass, voi= d *data) hc->unplug =3D ich9_pm_device_unplug_cb; adevc->ospm_status =3D ich9_pm_ospm_status; adevc->send_event =3D ich9_send_gpe; - adevc->madt_cpu =3D pc_madt_cpu_entry; amldevc->build_dev_aml =3D build_ich9_isa_aml; } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4d2b8d0444..6ac50506a7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -37,7 +37,9 @@ #include "hw/i386/topology.h" #ifndef CONFIG_USER_ONLY #include "exec/address-spaces.h" +#include "hw/acpi/acpi_cpu_interface.h" #include "hw/boards.h" +#include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" #endif =20 @@ -7114,6 +7116,9 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) CPUClass *cc =3D CPU_CLASS(oc); DeviceClass *dc =3D DEVICE_CLASS(oc); ResettableClass *rc =3D RESETTABLE_CLASS(oc); +#ifndef CONFIG_USER_ONLY + AcpiCpuAmlIfClass *acpuac =3D ACPI_CPU_AML_IF_CLASS(oc); +#endif FeatureWord w; =20 device_class_set_parent_realize(dc, x86_cpu_realizefn, @@ -7138,6 +7143,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) =20 #ifndef CONFIG_USER_ONLY cc->sysemu_ops =3D &i386_sysemu_ops; + acpuac->madt_cpu =3D pc_madt_cpu_entry; #endif /* !CONFIG_USER_ONLY */ =20 cc->gdb_arch_name =3D x86_gdb_arch_name; @@ -7203,6 +7209,13 @@ static const TypeInfo x86_cpu_type_info =3D { .abstract =3D true, .class_size =3D sizeof(X86CPUClass), .class_init =3D x86_cpu_common_class_init, + +#ifndef CONFIG_USER_ONLY + .interfaces =3D (InterfaceInfo[]) { + { TYPE_ACPI_CPU_AML_IF }, + { } + } +#endif }; =20 /* "base" CPU model, used by query-cpu-model-expansion */ --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314488; cv=none; d=zohomail.com; s=zohoarc; b=Ri1iNAZgm4CMUl1AwdYla0R5Qzo+WB8aH3UKaFQkC9WxkNPQ7VFHTty+hLzZYDcjUz8Rux6UHI9wcrek00tIh+hrj1mBBh2IjOwJW2EzW+JZHDRxYapYTxA9AMSfPluZAcYxa8+6hXvDTRGB29ngRk20hbjN3po0nLCGQ4SKK+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314488; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LmcAsHcDgaESdi0rbv2EOY5SZ3qNDR9/dJGcyl8UdkU=; b=FuzLZCi1CEtUwkDBqP+yxXU+oR6QWk+JtrxHADh4MYwR5auR1m2/eRZv5bG4gfrzFljbCt3BGgEQf+b6OVc4KsXakWFPHI3WM+Tn6jhfnkgfA6rhQcnHXr3dF8Y0Gjn6i7hMKULKj5OKLoz+kGIpK7ng2Qyf0pzlqpjKsM/2czI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314488907412.11485311628644; Sat, 21 Jan 2023 07:21:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFf2-0002AA-6P; Sat, 21 Jan 2023 10:20:04 -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 1pJFf0-00027x-8N; Sat, 21 Jan 2023 10:20:02 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFey-0005f2-Im; Sat, 21 Jan 2023 10:20:01 -0500 Received: by mail-ej1-x62f.google.com with SMTP id vw16so20722551ejc.12; Sat, 21 Jan 2023 07:19:59 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:19:58 -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=LmcAsHcDgaESdi0rbv2EOY5SZ3qNDR9/dJGcyl8UdkU=; b=M4EVkEivCQ3DvXR7lu0cWf3siogDAapyU3En/Ela+xnyJ6/lF9k8wfMGmRMHcRSVa9 mkTB5LIFoGqQPUHe1wYp6o5D80gSRLY41cj+2kP90hCcIksKC7BJBrUHa6TyVEmHc6kn uTE7+GniuNvj0yGcWm/wre82T/BTe54jHyddLZK+Cglj4n8eBKwYIh34Flw8og2fVgB6 GnJHP9Xo9IdU+y24/z6LmuGjGrz3IvdaJdro+pQEmUEJXhlzGIUByNjQo3efr3DSlB76 d6gXKlMq/odlbtE3gVBcaj8TaWqNV3jxbtccXeCNwZAmdanaSgYoctykR92OHcGbKMUr GZTw== 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=LmcAsHcDgaESdi0rbv2EOY5SZ3qNDR9/dJGcyl8UdkU=; b=qEg1YeaUoa15CJWIeHaeFcoW7MtM3f5dJtU2KP+gVt+wkgpTwPpuvWfunKXaDW/hYw f12crdlgIinGiXJpxlFngucqO4Bz2eZ4CJl+DqSD59geDYbA7/M9gLRR5xbSFLYxJ5V6 l9Wjd38RzfejzJ95YwdQjTR8tRQG1TaVZ6OsQ0F7xR5a8WWuUVFID/MKHba8cI66AcS4 WLrv+hNa7KYEXyOAtm0lRF7nLQYQynbeV/yxGjv0ddC/CU9RpPh6M3NeRFeKKSqFJq0X 935GLYTPZpNO1MOOTzDhtg8aXM6JoUlFajWIN5LEmojU6nemmH7W6hbkcQgx7tBRcaN9 lyRg== X-Gm-Message-State: AFqh2kpMc9lCuhNneLtyICOlmf+JpNOHkpmoZYS57/uT8Q/4yitETT3q 8Dv3dH1ETF9KTpeyLrZ89lb9qrNKrkEN4Q== X-Google-Smtp-Source: AMrXdXsxRnz8ErVDlnmLl0+ikx/ZbkjpM5kr5lztHjFD4YuRTg59y8qUfPAuEUseU1bU/BwHYTWjhA== X-Received: by 2002:a17:907:2c66:b0:7c4:f752:e959 with SMTP id ib6-20020a1709072c6600b007c4f752e959mr23181838ejc.33.1674314399341; Sat, 21 Jan 2023 07:19:59 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 6/7] hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" Date: Sat, 21 Jan 2023 16:19:40 +0100 Message-Id: <20230121151941.24120-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314489605100001 Content-Type: text/plain; charset="utf-8" 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 =20 -#include "hw/acpi/aml-build.h" +#include "hw/acpi/bios-linker-loader.h" +#include "sysemu/numa.h" =20 /* * 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_de= v_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 @@ =20 #include "qapi/qapi-types-acpi.h" #include "qom/object.h" -#include "hw/boards.h" #include "hw/qdev-core.h" =20 /* 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 f6647e99b1..1a7eb54c98 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -2,6 +2,7 @@ #include "migration/vmstate.h" #include "hw/acpi/acpi_cpu_interface.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" =20 /* 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 bf22a8c5a6..051b825986 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -41,6 +41,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" =20 NameInfo *qmp_query_name(Error **errp) --=20 2.39.1 From nobody Sat Apr 20 02:41:49 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674314465; cv=none; d=zohomail.com; s=zohoarc; b=PIhz2qfLAXJf4OhvqsmTdmXUZWfni0iVlXyeG6GE9vbnLKaTn+Q/u7sYi7RjIh7ar5ggx5Nz3s3SRKdPH8P/GFv/t3PXH5z00I1wDFWtJh8NzAtpvIh5rjAbM5b4L/HGeu78CNSmbzAf2IjUnypCkPmFuVb/8AFT9oq5wwemIdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674314465; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tU6Jk+zwzPrJt9pMjO3BEjB9c4BsylYnyegphPxSBBg=; b=KI85Ae6BZ7Gr1i/rMKmoYcRYcUFum+gtrfzu8euGNRthPXrgYl7mmliD9n+FsbcuqKLrlRvF1mEvM69r9J9Nl8hkVqbgZwXR80FB0qDlntNA8bFn4hoaNFFinKLsG7QMRrIka7aXu4iiRmyH6uFBA1DhkisqFMoKUDiuRVXW0GY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674314465059237.16804430803552; Sat, 21 Jan 2023 07:21:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJFf3-0002B1-Hc; Sat, 21 Jan 2023 10:20:05 -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 1pJFf1-00029X-U0; Sat, 21 Jan 2023 10:20:03 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJFf0-0005ep-0R; Sat, 21 Jan 2023 10:20:03 -0500 Received: by mail-ej1-x62e.google.com with SMTP id v6so20786083ejg.6; Sat, 21 Jan 2023 07:20:01 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id 20-20020a170906101400b0085ff05d5dbdsm14162567ejm.173.2023.01.21.07.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 07:20:00 -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=tU6Jk+zwzPrJt9pMjO3BEjB9c4BsylYnyegphPxSBBg=; b=j1r6QEpqf6JxItl0apZ3bIAsmhmFVViUxmDS0kmmK1a32byIngk9+qvUc3bNWUzhCt dav7NMOiSlV9Py0djShtEK+JBZI7zovLfq/ycNx6xoiQLP5MRCA7jZZ1Hvmki0Eyt1Bf HiUvltM7PAsc+l33HPlckNv/9/SLcSB9pDxz1wiQsGZhc/b3lwUIA17nIf0ZgCbL2ZUf ipzysSoxGpaYli9oih5g8VSWFZrC7DWCJds9lWyN+FlHGf637d5nvP0i2ywetSQ6nwOa x0bsf7HUPd5qONNjQAMlPb20kkfeH9g2z+6ojZApCbI3Cd0S6gvckkQCRWj/UOVzhcu5 43pA== 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=tU6Jk+zwzPrJt9pMjO3BEjB9c4BsylYnyegphPxSBBg=; b=p0U/hNM80HzDSqAmYrI/0NMPw095ab8PXuGMOw0SyxRi7t+tMlR4TT2B76ycZsn5rB CgOvjNzmaP8F/yRjA8vaM7s/SMk9ky2aS4UK8AqrXKcC6ezMURkGzxu3RJYANxed8Cd6 go/8S6bZ4109tab26QQdplVD7v6LJn//j7zmc1qRypllAZwS3VLo8azqfpca02sJcth9 bcvT8q6mcWFlQuuE2XoY1RaJNpxEnmRb8qpe259vX6/myHwbwgRwA5lV7hLbXzJ4Mdnn POoVs/uzUKIrZDxLHasuNNVRgFae+bYpRKUd8Aw9Qwx367r2l7/ehexuc1qxO3mWovGu W6zg== X-Gm-Message-State: AFqh2koQKDnFdeTkipqJ7M8up5cHrYIsw1APRiZvhScBjg493KPPsJZI tL3cw1w/xq5o553dsDegavfBMjn297LLgg== X-Google-Smtp-Source: AMrXdXs0a1hYuVlbN93yMdgia4pXvyQHuSvzV7IWIP8XjU1wIkJpoNJoDcrnCf4wMBMg38PTd/S8bA== X-Received: by 2002:a17:907:20a1:b0:870:23c5:8a81 with SMTP id pw1-20020a17090720a100b0087023c58a81mr20677826ejb.41.1674314400550; Sat, 21 Jan 2023 07:20:00 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , qemu-trivial@nongnu.org, Aurelien Jarno , Eduardo Habkost , Ani Sinha , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Igor Mammedov , Paolo Bonzini , Markus Armbruster , Bernhard Beschow Subject: [PATCH v4 7/7] hw/i386/pc: Unexport pc_madt_cpu_entry() Date: Sat, 21 Jan 2023 16:19:41 +0100 Message-Id: <20230121151941.24120-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230121151941.24120-1-shentey@gmail.com> References: <20230121151941.24120-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1674314468125100002 pc_madt_cpu_entry() is now only used in target/i386/cpu, so move it there, and unexport and rename it. Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 4 ---- hw/acpi/acpi-x86-stub.c | 6 ------ hw/i386/acpi-common.c | 33 --------------------------------- target/i386/cpu.c | 37 +++++++++++++++++++++++++++++++++++-- 4 files changed, 35 insertions(+), 45 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 66e3d059ef..9ab1818812 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, uint= 8_t **data, int *data_len); void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size); =20 -/* 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); =20 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" =20 -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/i386/acpi-common.c b/hw/i386/acpi-common.c index 0d1a2bb8aa..0041623aeb 100644 --- a/hw/i386/acpi-common.c +++ b/hw/i386/acpi-common.c @@ -28,44 +28,11 @@ #include "hw/acpi/acpi_cpu_interface.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/utils.h" -#include "hw/i386/pc.h" #include "target/i386/cpu.h" =20 #include "acpi-build.h" #include "acpi-common.h" =20 -void pc_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids, - GArray *entry, bool force_enabled) -{ - uint32_t apic_id =3D apic_ids->cpus[uid].arch_id; - /* Flags =E2=80=93 Local APIC Flags */ - uint32_t flags =3D apic_ids->cpus[uid].cpu !=3D NULL || force_enabled ? - 1 /* Enabled */ : 0; - - /* ACPI spec says that LAPIC entry for non present - * CPU may be omitted from MADT or it must be marked - * as disabled. However omitting non present CPU from - * MADT breaks hotplug on linux. So possible CPUs - * should be put in MADT but kept disabled. - */ - if (apic_id < 255) { - /* Rev 1.0b, Table 5-13 Processor Local APIC Structure */ - build_append_int_noprefix(entry, 0, 1); /* Type */ - build_append_int_noprefix(entry, 8, 1); /* Length */ - build_append_int_noprefix(entry, uid, 1); /* ACPI Processor ID= */ - build_append_int_noprefix(entry, apic_id, 1); /* APIC ID */ - build_append_int_noprefix(entry, flags, 4); /* Flags */ - } else { - /* Rev 4.0, 5.2.12.12 Processor Local x2APIC Structure */ - build_append_int_noprefix(entry, 9, 1); /* Type */ - build_append_int_noprefix(entry, 16, 1); /* Length */ - build_append_int_noprefix(entry, 0, 2); /* Reserved */ - build_append_int_noprefix(entry, apic_id, 4); /* X2APIC ID */ - build_append_int_noprefix(entry, flags, 4); /* Flags */ - build_append_int_noprefix(entry, uid, 4); /* ACPI Processor UI= D */ - } -} - static void build_ioapic(GArray *entry, uint8_t id, uint32_t addr, uint32_= t irq) { /* Rev 1.0b, 5.2.8.2 IO APIC */ diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6ac50506a7..b05062bc57 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -38,8 +38,8 @@ #ifndef CONFIG_USER_ONLY #include "exec/address-spaces.h" #include "hw/acpi/acpi_cpu_interface.h" +#include "hw/acpi/aml-build.h" #include "hw/boards.h" -#include "hw/i386/pc.h" #include "hw/i386/sgx-epc.h" #endif =20 @@ -7108,6 +7108,39 @@ static const struct SysemuCPUOps i386_sysemu_ops =3D= { .write_elf64_qemunote =3D x86_cpu_write_elf64_qemunote, .legacy_vmsd =3D &vmstate_x86_cpu, }; + +static void x86_madt_cpu_entry(int uid, const CPUArchIdList *apic_ids, + GArray *entry, bool force_enabled) +{ + uint32_t apic_id =3D apic_ids->cpus[uid].arch_id; + /* Flags =E2=80=93 Local APIC Flags */ + uint32_t flags =3D apic_ids->cpus[uid].cpu !=3D NULL || force_enabled ? + 1 /* Enabled */ : 0; + + /* + * ACPI spec says that LAPIC entry for non present + * CPU may be omitted from MADT or it must be marked + * as disabled. However omitting non present CPU from + * MADT breaks hotplug on linux. So possible CPUs + * should be put in MADT but kept disabled. + */ + if (apic_id < 255) { + /* Rev 1.0b, Table 5-13 Processor Local APIC Structure */ + build_append_int_noprefix(entry, 0, 1); /* Type */ + build_append_int_noprefix(entry, 8, 1); /* Length */ + build_append_int_noprefix(entry, uid, 1); /* ACPI Processor ID= */ + build_append_int_noprefix(entry, apic_id, 1); /* APIC ID */ + build_append_int_noprefix(entry, flags, 4); /* Flags */ + } else { + /* Rev 4.0, 5.2.12.12 Processor Local x2APIC Structure */ + build_append_int_noprefix(entry, 9, 1); /* Type */ + build_append_int_noprefix(entry, 16, 1); /* Length */ + build_append_int_noprefix(entry, 0, 2); /* Reserved */ + build_append_int_noprefix(entry, apic_id, 4); /* X2APIC ID */ + build_append_int_noprefix(entry, flags, 4); /* Flags */ + build_append_int_noprefix(entry, uid, 4); /* ACPI Processor UI= D */ + } +} #endif =20 static void x86_cpu_common_class_init(ObjectClass *oc, void *data) @@ -7143,7 +7176,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc= , void *data) =20 #ifndef CONFIG_USER_ONLY cc->sysemu_ops =3D &i386_sysemu_ops; - acpuac->madt_cpu =3D pc_madt_cpu_entry; + acpuac->madt_cpu =3D x86_madt_cpu_entry; #endif /* !CONFIG_USER_ONLY */ =20 cc->gdb_arch_name =3D x86_gdb_arch_name; --=20 2.39.1