From nobody Sun Dec 14 06:32:57 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667862965; cv=none; d=zohomail.com; s=zohoarc; b=ChXPH8qljAhBj7Vah9MDyRyoLBRAYuGCJnA2JaahfXzVBla8z90s6Ku0qXvY6eBuld8n2faf16h6ggggIYDAs6XNGl4pilsBgmbqpkp6/MdimLQGxdf6dKWGZbD7tKNPn++gwT+gA7hQI/N53I17k7Z1TWt551KyicPjyG4EQVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667862965; h=Content-Type: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=ARh2sl8Vb/DTthXngVp+HQaYKzL6p5aL6+WOaFC/kmA=; b=OxLCufYovZLjPCkCNHKOhGBmvy2BwlnmUFfuRh7aL/8n7pTNXjmm8EWFGGcWq2IDoI8sfIXoSsLaHeeMSMVZD6ZJBMoKU8xytXtTaQFcDUlutPn20iYTYMp0G003BupwLnSL1lDrv+QfMWEF68oGTJtD5tR9qS1LwQ1FT4WdTn0= 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 1667862965304230.29137541769535; Mon, 7 Nov 2022 15:16:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osAz9-0004vZ-Up; Mon, 07 Nov 2022 17:52:55 -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 1osAz3-0004u6-N6 for qemu-devel@nongnu.org; Mon, 07 Nov 2022 17:52:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osAyv-0007o0-Lh for qemu-devel@nongnu.org; Mon, 07 Nov 2022 17:52:42 -0500 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-455-fYyoyU7CPIOHFDZ2KAEdfA-1; Mon, 07 Nov 2022 17:52:39 -0500 Received: by mail-qt1-f199.google.com with SMTP id v12-20020ac8578c000000b003a50eb13e29so9070473qta.3 for ; Mon, 07 Nov 2022 14:52:39 -0800 (PST) Received: from redhat.com ([87.249.138.11]) by smtp.gmail.com with ESMTPSA id r16-20020ac87ef0000000b003996aa171b9sm6773520qtc.97.2022.11.07.14.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 14:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667861561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ARh2sl8Vb/DTthXngVp+HQaYKzL6p5aL6+WOaFC/kmA=; b=PgPIlIbNvDwVu2XpnJIZHW2znPORmRtEWZmuedEx4jUWSi0CaLH5WVMejGslbw0428rmHW eRV/rhGxe2d2kb6UEkJpE5YdCliAIMfbMIsnmawamIFxE3lUBF7d1sB211f3+S1LfTUdIQ ZMbcdOiVaELX6EQJIz5xWXr/QwC+1ts= X-MC-Unique: fYyoyU7CPIOHFDZ2KAEdfA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ARh2sl8Vb/DTthXngVp+HQaYKzL6p5aL6+WOaFC/kmA=; b=mnQArBygiHqdYcJNT+3n62WF+ashWWwDpTjucxyvjEJ2ubeM2Fd6tMWKcXPCD2UnOG bFp74a2G8HcPMs5BcIIHyHhp8hzAWZDOQPJHVAPJ39x6QZ24JDo57gDYEnMxhGYUz0Cg xsTXxVTshGdNrUPdOrenUd9JstfLXHVhA/kFYc6CejpXFFVJVzjwzpcgqTi4kX6em4vu d53RuaCThUNRkclvLOeDSBF7uQjGYNOhsZiaFHXC4e7IIsXteCXey80AC/1ufGDTN4GB CrMVxH6s6NWuomj8pkTv1iy/xKNqmGRrzQP51VBLGktouDjBvRWAmGhvSF/QqMVzya6m C2PQ== X-Gm-Message-State: ACrzQf2exxCrOxjUsaKFAnaeiJXCztlZyzCCMB+Vr3sE0Ggs2vDA2Raj gcoXk5WCUU8/+C9Pr9XGmTQzaRzCZbA0FhWxrtpFOWsSaeC3mBhV/Vwk1u6BNqZlCmoJ7gccvWW fPwJUIM/pa4bHs725x2XgiivtT5G+A8jQfTc7PS4ZzEcwekM+Wy6FEFOQ1xtx X-Received: by 2002:a0c:9091:0:b0:4bb:5477:c22c with SMTP id p17-20020a0c9091000000b004bb5477c22cmr47878323qvp.85.1667861559321; Mon, 07 Nov 2022 14:52:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM4q4cUfWSrLU8FPSnE2cntuaii2KQObygl7YDyRR46ASYuAj4rUNF6O94sI5T+/LTbntgzVgQ== X-Received: by 2002:a0c:9091:0:b0:4bb:5477:c22c with SMTP id p17-20020a0c9091000000b004bb5477c22cmr47878302qvp.85.1667861559064; Mon, 07 Nov 2022 14:52:39 -0800 (PST) Date: Mon, 7 Nov 2022 17:52:33 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL v4 61/83] hw/i386/acpi-build: Resolve north rather than south bridges Message-ID: <20221107224600.934080-62-mst@redhat.com> References: <20221107224600.934080-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221107224600.934080-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667862967431100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow 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 Message-Id: <20221028103419.93398-4-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 MST