From nobody Sat May 18 09:48:26 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666953447; cv=none; d=zohomail.com; s=zohoarc; b=dNVDaEo66CMkDLSyNcpuuoFl2yRZeivN5qGvmVL9Q5zaUDRAuJN5jh42vbrfV1L9JGd1WbLROHHWkKACVcKBXhxDre++uZEN66f3tjbXPNMu7TWKha9ZEaXwihZt1qv+mhh2OzT7blviUCU5sl97jukaXMvzHIeuYcZ2NybE4V0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666953447; 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=8dkns/xOgo85WY2NG3Q19/5apWzD74CXMaLQmzMC8uI=; b=SdFeKK+aeRpJqfRea7+QxwMS2y5xI98lQ/bRVamlFfugIHAoPwOH7HuUWJeGcDQYaTCCwjgNBl2+nBXmfCPEeOKBvrMRz1UDlOJt1HHMLdIZ7kror49ITwRSXUSpfj7lUKPaHbZUvhPxQZzMfr04vFGKMtVkVI/S6o1a5Dsc5xI= 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+importer=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 1666953447411791.0858057823655; Fri, 28 Oct 2022 03:37:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooMi8-0006m8-Ki; Fri, 28 Oct 2022 06:35:36 -0400 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 1ooMi6-0006lA-2h; Fri, 28 Oct 2022 06:35:34 -0400 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 1ooMi4-0001iE-KT; Fri, 28 Oct 2022 06:35:33 -0400 Received: by mail-ej1-x62e.google.com with SMTP id t25so11945618ejb.8; Fri, 28 Oct 2022 03:35:31 -0700 (PDT) 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 p1-20020a17090653c100b0078128c89439sm2050527ejo.6.2022.10.28.03.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:35:29 -0700 (PDT) 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=8dkns/xOgo85WY2NG3Q19/5apWzD74CXMaLQmzMC8uI=; b=ByeFZ/WVsywk4AYNRDYSnEswnSL6269bdt+xOfm2nRK+8H5hCpjqp/hMDJ4l5IbAAj 2q7caWUSOvfnoBC35FNH7B5dgJIUPRSL9QJa0pzk0ZbcnDz008IFMQsrciGqu1lMr3oU hiX1cIKnlZ2qNs0JS2DT2zMHiJG/pejJc64PzkvJkFhQfhPM6DwPW48glsNwzuf5/04w tJezIEzxLuBm3cXet3Trd+G2bNRi2WTtJrsil7vBp2g1xVZxyKDQsUQaQ/gg/PsXQt1i l+3R5t9Ljw9iPpnrPVSfJIWKSj5Hjh1e6pVnqG9wPvedM9Eu2tbDXSw2V/Q6tUgq54oP 2NVw== 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=8dkns/xOgo85WY2NG3Q19/5apWzD74CXMaLQmzMC8uI=; b=OeA8TmfqtDQ6x5nPWcT8Lgof9IS01v+ZKLJGjQ0Bos9G1eApbIX1bJntUqw3sVDJMG AFNmmYARYG7wdtauy316uiqATCg71jUysD6+b/CUbfFFntA7Rg+EJW0m1euXR6d93jFU hLPDV0QVwv+KQ7ku/eardggdePPeE1zbzyz4p65Re3U9RGEoGtd6f5Dd75Jfw/KjB8eC hnYIwpw0AJU5lwxJ3ZGlU/JPb/30RcFP/FiQ5BqRgQSpq2Hbt8/UOOULbnL75XbpI6Rp KFdOJbivBbBd+Nj3pSneSNvr0B+90HLpzT0xDKLwoMWKWl2TQEmGAMvbx2l9gMzVp76O lnIQ== X-Gm-Message-State: ACrzQf3Js4FZtSEvbRuatvgLkK2X1RiBOHBBRXuebVFCfgYk6tOM0nCC LVNftDO5SgUOKb5rpyFFpP/Wytlk5bs= X-Google-Smtp-Source: AMsMyM5qwrG330k6NXZwiD/C6kPXC+sUjiNWIWs8mPUrQi+H8YxrP1N62eZHRkyM85RXEpnEHAFj4w== X-Received: by 2002:a17:907:a0c6:b0:7ad:a030:7499 with SMTP id hw6-20020a170907a0c600b007ada0307499mr1810420ejc.552.1666953329437; Fri, 28 Oct 2022 03:35:29 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , qemu-trivial@nongnu.org, Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/3] hw/i386/acpi-build: Remove unused struct Date: Fri, 28 Oct 2022 12:34:17 +0200 Message-Id: <20221028103419.93398-2-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028103419.93398-1-shentey@gmail.com> References: <20221028103419.93398-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+importer=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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1666953448673100001 Ammends commit b23046abe78f48498a423b802d6d86ba0172d57f 'pc: acpi-build: simplify PCI bus tree generation'. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221026133110.91828-2-shentey@gmail.com> Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 960305462c..1ebf14b899 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -121,13 +121,6 @@ typedef struct AcpiMiscInfo { unsigned dsdt_size; } AcpiMiscInfo; =20 -typedef struct AcpiBuildPciBusHotplugState { - GArray *device_table; - GArray *notify_table; - struct AcpiBuildPciBusHotplugState *parent; - bool pcihp_bridge_en; -} AcpiBuildPciBusHotplugState; - typedef struct FwCfgTPMConfig { uint32_t tpmppi_address; uint8_t tpm_version; --=20 2.38.1 From nobody Sat May 18 09:48:26 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666953413; cv=none; d=zohomail.com; s=zohoarc; b=N5+xMfnVMAwQGwxX7KtHns2nsAs8x9jRkT9EzheKvEXrWA89jzBVYDfYGbCNR80jNxZ3J189bn/UlzCS1y2W5rzpRTI35NUJS5dsqCvrkGclI3gwT1l65Y/9/YxNFK+gYMW4dhk28YFMuDB2YpmqsZsTVu8Wx0mn/u7WI50TLJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666953413; 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=+uyFQ29muJG9K5iydquCCKJMd020oeRBjlgn0yovGN0=; b=aM5Kzr57VTqosnMrauZq+Voi3nEFtPv5EbpWSsPejo+NdanbZQVDZUfJ+kDxspLRpGDQDj9X9apyRVDq0oTT/aqBc/Eu8+mbw6o6th1xdq5Rnajf4a0fXi0KoumWxt/B3guOPZVeFu3I49HKGvpfMTpxxjA8gFpooNNnd8YYn9s= 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+importer=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 1666953413956282.17670475109753; Fri, 28 Oct 2022 03:36:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooMiF-0006nv-Va; Fri, 28 Oct 2022 06:35:44 -0400 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 1ooMi6-0006lE-Dm; Fri, 28 Oct 2022 06:35:34 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooMi4-0001iX-OH; Fri, 28 Oct 2022 06:35:34 -0400 Received: by mail-ed1-x534.google.com with SMTP id a13so7288050edj.0; Fri, 28 Oct 2022 03:35:32 -0700 (PDT) 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 p1-20020a17090653c100b0078128c89439sm2050527ejo.6.2022.10.28.03.35.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:35:30 -0700 (PDT) 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=+uyFQ29muJG9K5iydquCCKJMd020oeRBjlgn0yovGN0=; b=oCVg5zghrptz7oIK+jW+1YAMJzmEtFmV49xaCaIfmVwA74O42vlTwo0Z96Kt54pc9m catXJz1KzzhwZ7BZcYySqEB6Fv1KE8DChuFnXVaoNLihlIOSaoCUrf8CpMZgf4yQt/+b np/gBudLsuhiVReX8d3UwBSDrfvc8A10kENlndpLUtb2YYevm9Uws4kJqFwCrdvpEK05 Hv0XyvchNa1DGYqNuaSy+ojwjHZ/L0OsfId+0R96E3mGX2plwDRSIpAhSuaJKk8PawUB SIZwV1Her40g2GfO4E4oLQsXejyyVZugmWRmvn7nWp/UZmVovMx3DHsEr63qRfrC/fRu s6wA== 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=+uyFQ29muJG9K5iydquCCKJMd020oeRBjlgn0yovGN0=; b=384F4kW9bPotwRLxA9003Bv0DOtAlhWCb70IvD43jqo2qrPImvHCA8kwNC9jJUX/Qj nx0uTqsrEUMWsBd71dEbukT+wSz8MY7GpSOtx0kjyTXBasjgOJlAWMvB+tNGuFBqEP/t l08lJjGeQ4KZgbnZofeeu61BwK6/vma+6eSGX4/ggSIySyiKaX2o/tmPT5CSrF819ISP 2xfzvdVxf5PzhdeNbwLuU0UlQ6rxpFwk1cRi7u8KLBEVJUFyeZMERmd0GlTul4uPzVZa wG6N4VgH+Syx0E5cRyMFXlU9yOzWag/vmUxstLtTUuSix2ai+/NQFy2+PiQZW51suoQN MeGQ== X-Gm-Message-State: ACrzQf1/KOGFZup4GoOcn5i1OTW0GJDTE52rrrFpEzizDsdJLgg5rXQj qPhYk7fexB4/H1f4v+jyFg6VXvjP54Y= X-Google-Smtp-Source: AMsMyM7/X28po9S7tKj1G3iobxzKhY8X1V1FOAw52cKKMHoeMWrqg1pyKcg3RZCfYgMNvL2/8wAh7Q== X-Received: by 2002:a05:6402:280a:b0:461:9845:d9c9 with SMTP id h10-20020a056402280a00b004619845d9c9mr29033287ede.268.1666953330596; Fri, 28 Oct 2022 03:35:30 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , qemu-trivial@nongnu.org, Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Bernhard Beschow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/3] hw/i386/acpi-build: Resolve redundant attribute Date: Fri, 28 Oct 2022 12:34:18 +0200 Message-Id: <20221028103419.93398-3-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028103419.93398-1-shentey@gmail.com> References: <20221028103419.93398-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=shentey@gmail.com; helo=mail-ed1-x534.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1666953414952100001 The is_piix4 attribute is set once in one location and read once in another. Doing both in one location allows for removing the attribute altogether. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20221026133110.91828-3-shentey@gmail.com> --- hw/i386/acpi-build.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1ebf14b899..73d8a59737 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -112,7 +112,6 @@ typedef struct AcpiPmInfo { } AcpiPmInfo; =20 typedef struct AcpiMiscInfo { - bool is_piix4; bool has_hpet; #ifdef CONFIG_TPM TPMVersion tpm_version; @@ -281,17 +280,6 @@ static void acpi_get_pm_info(MachineState *machine, Ac= piPmInfo *pm) =20 static void acpi_get_misc_info(AcpiMiscInfo *info) { - Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); - assert(!!piix !=3D !!lpc); - - if (piix) { - info->is_piix4 =3D true; - } - if (lpc) { - info->is_piix4 =3D false; - } - info->has_hpet =3D hpet_find(); #ifdef CONFIG_TPM info->tpm_version =3D tpm_get_version(tpm_find()); @@ -1334,6 +1322,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, Range *pci_hole, Range *pci_hole64, MachineState *machine) { + Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; CrsRangeSet crs_range_set; @@ -1354,11 +1344,13 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiTable table =3D { .sig =3D "DSDT", .rev =3D 1, .oem_id =3D x86ms->= oem_id, .oem_table_id =3D x86ms->oem_table_id }; =20 + assert(!!piix !=3D !!lpc); + acpi_table_begin(&table, table_data); dsdt =3D init_aml_allocator(); =20 build_dbg_aml(dsdt); - if (misc->is_piix4) { + if (piix) { sb_scope =3D aml_scope("_SB"); dev =3D aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); @@ -1371,7 +1363,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); } build_piix4_pci0_int(dsdt); - } else { + } else if (lpc) { sb_scope =3D aml_scope("_SB"); dev =3D aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); --=20 2.38.1 From nobody Sat May 18 09:48:26 2024 Delivered-To: importer@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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1666953455; cv=none; d=zohomail.com; s=zohoarc; b=YWNWp1XxSSJmhnLCNWmnz+LcJuW/YOm0muNDH50ZiXdYfRIiBXaemnXzNYjy0R/MB4I6hkh4aUwu+DTLAftTbu9bDzcTivJfHYBw7NWxKIjqAtobFR4wvUHFtHB5G6+Bupkl7B5coZZLqJTZqzpOElJfjcdv0u3i8w/kihvPQYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666953455; 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=sjyyw6XSUvwVzBhL8WZKkTOeS8jyps+AR2UJlYWQ3zA=; b=OKO5tRBw/bcBe8eu8m2OQjNr1GGqmaindDqoJgNn0KMVl6kgG3qbWEKxxdF2O7Jm6S9tfxeOjdZTPLqhm5YO5hGrEd57GAEoKAGUs/JTEO/fiAmD3mcsVtltlpn7WyZJEgzKjow6MAHPYfHyRIT6x9WdMfluim5F07Wn851ibsk= 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+importer=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 1666953455155393.0321794776303; Fri, 28 Oct 2022 03:37:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooMiA-0006mp-9F; Fri, 28 Oct 2022 06:35:38 -0400 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 1ooMi7-0006lg-E4; Fri, 28 Oct 2022 06:35:35 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooMi5-0001jN-Pf; Fri, 28 Oct 2022 06:35:35 -0400 Received: by mail-ed1-x532.google.com with SMTP id a5so7212676edb.11; Fri, 28 Oct 2022 03:35:33 -0700 (PDT) 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 p1-20020a17090653c100b0078128c89439sm2050527ejo.6.2022.10.28.03.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 03:35:31 -0700 (PDT) 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=sjyyw6XSUvwVzBhL8WZKkTOeS8jyps+AR2UJlYWQ3zA=; b=ZdygQ7GZAFpUsMCLjc1nqC0+GDRsdXWukUMqPXF63SKq7nrUGi6BrQhuLv+84u97M5 etD6o8asQCsdcvVnvTY4dYvd3AF1HecC9GRZ6HojRdRhdmNR0iv8gVh/aRT6a1gUSU8E ST4DW1EnG6KBsYeCR7Tf/JcJgTj4SFvJIc89Sh1B5UX6HW62ntPHTjQEe9F97pFKdixM Q/U5GEsGkX7psYa/swxY9wk8NUYGX1jvXHCGricw/WCuldb1Vug9qikG674/Ot3/mf0y FA1HA6BOWXyjcKLiTMi47OuTMCtaecBKRY1Ejr+7Ygm3LCTwbc+jv6MnM+z/5wHgzb39 2wgg== 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=sjyyw6XSUvwVzBhL8WZKkTOeS8jyps+AR2UJlYWQ3zA=; b=5TORlt8TpbOgsljMzO92H6bNTYdjZXkC1u+SA5QOjiGOW615jFL066dZVkt2No0JWC ajB0YMszsiyuAMrvv6AV7L7hmfArnssqyIraRiQ3jzrPTZZO3rvzNnsWTJVRvnVpC1y+ L19V953RQGE1WR0b+WEtBQ6R58BAN4AO2LPiGDWYIKjkJr3kx5de+N6Czjx+PXKpxwru AzR9uLEU4LjCRmN/yx2qZl5hU8emqVO0YkY44GMHnqH8+dgd16qx/7sme0okJdbGiI43 0Ngp0dAsdSLicXxzP2uNvUlopPHeQW7maDZ9qMbNZZRWto2UyJcihTdlIpu6tSmeLDIc fErA== X-Gm-Message-State: ACrzQf3kxHbsSKV4nWhmQPwqCxvwSoD6RX646RC02zFvSzodhK31XDFo PCct4Y4zCIuk0Imi5s2ZeAfYrmhyy9I= X-Google-Smtp-Source: AMsMyM7FlzSUqRxrHkPo5Va1RZIhnkJoqBD4tizYoXfci8rmMdqaWukxF+zLFoV1uIcdVwB1/HtceQ== X-Received: by 2002:a05:6402:40d0:b0:462:7b99:d424 with SMTP id z16-20020a05640240d000b004627b99d424mr9809679edb.62.1666953331765; Fri, 28 Oct 2022 03:35:31 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , qemu-trivial@nongnu.org, Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Ani Sinha , Bernhard Beschow Subject: [PATCH v2 3/3] hw/i386/acpi-build: Resolve north rather than south bridges Date: Fri, 28 Oct 2022 12:34:19 +0200 Message-Id: <20221028103419.93398-4-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221028103419.93398-1-shentey@gmail.com> References: <20221028103419.93398-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=shentey@gmail.com; helo=mail-ed1-x532.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1666953456780100001 Content-Type: text/plain; charset="utf-8" The code currently assumes Q35 iff ICH9 and i440fx iff PIIX. Now that more AML generation has been moved into the south bridges and since the machines define themselves primarily through their north bridges, let's switch to resolving the north bridges for AML generation instead. This also allows for easier experimentation with different south bridges in the "pc" machine, e.g. with PIIX4 and VT82xx. Signed-off-by: Bernhard Beschow Reviewed-by: Ani Sinha --- hw/i386/acpi-build.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 73d8a59737..d9eaa5fc4d 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -60,6 +60,7 @@ #include "hw/i386/fw_cfg.h" #include "hw/i386/ich9.h" #include "hw/pci/pci_bus.h" +#include "hw/pci-host/i440fx.h" #include "hw/pci-host/q35.h" #include "hw/i386/x86-iommu.h" =20 @@ -1322,8 +1323,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, Range *pci_hole, Range *pci_hole64, MachineState *machine) { - Object *piix =3D object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + Object *i440fx =3D object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOS= T_BRIDGE); + Object *q35 =3D object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE); CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; CrsRangeSet crs_range_set; @@ -1344,13 +1345,13 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiTable table =3D { .sig =3D "DSDT", .rev =3D 1, .oem_id =3D x86ms->= oem_id, .oem_table_id =3D x86ms->oem_table_id }; =20 - assert(!!piix !=3D !!lpc); + assert(!!i440fx !=3D !!q35); =20 acpi_table_begin(&table, table_data); dsdt =3D init_aml_allocator(); =20 build_dbg_aml(dsdt); - if (piix) { + if (i440fx) { sb_scope =3D aml_scope("_SB"); dev =3D aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); @@ -1363,7 +1364,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); } build_piix4_pci0_int(dsdt); - } else if (lpc) { + } else if (q35) { sb_scope =3D aml_scope("_SB"); dev =3D aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); --=20 2.38.1