From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FBDFC4332F for ; Wed, 2 Nov 2022 16:18:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqGLg-0003uY-9b; Wed, 02 Nov 2022 12:12:16 -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 1oqGLP-0003Hf-Ju for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:11:59 -0400 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 1oqGLL-0003ki-D3 for qemu-devel@nongnu.org; Wed, 02 Nov 2022 12:11:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667405504; 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=JuoUa4+/p3TjMEmYkTzM5Z8/6YzmlrNwMgiW/qXKRF+mA4h0E18jVtIVdh3enZ1rUguiYG 7HkRzIzfTgsm+UNGVElQ4JyuZQbJ+g9394OMKDyc7+8ZHKGuiiEjy2/AZQjqrn3iOv7j/3 kgZVqFuW8d7EZ39Z4blvtpfYmyjbwY8= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-103-yb7gOOFQMh21TQ_zkav1xQ-1; Wed, 02 Nov 2022 12:11:43 -0400 X-MC-Unique: yb7gOOFQMh21TQ_zkav1xQ-1 Received: by mail-wm1-f69.google.com with SMTP id bg25-20020a05600c3c9900b003cf3ed7e27bso8096339wmb.4 for ; Wed, 02 Nov 2022 09:11:43 -0700 (PDT) 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=Ckvqp0Z38lGLlVcURHlYeSn8Mv3pk0pxXsGZcg1ZeBcFLJGO4PD+89RuFtBx4oIKGd P4zeO+paDL+nI7dCbb8T0NGpKV3cR2jRNq/DpBo7OXB+YMG/v/PRrYFCRsbVwuHhBfD5 8u8v3Y/OldONTwvRfkoWcGVB9v5OLZbRp0m5QHpHUfniXpNXDqeiimy8whN+1pYzb0VU TVG+Yx9UxHoRXgAPBSw9vBNay5w0n2sA4pIKpsAD4D4MRkUdU8L2kX+SpgGBWebjdaEf X1hWki1E/4h6pS8YZrUW/m+C7o7EGCmRt+lVkPcSpZ7lj92b0/hFMkVuv+BoOY5eGF7b w+FQ== X-Gm-Message-State: ACrzQf0ii1BkAf0VSYdsBfIvY376swkx1C0i+3VGuNAg7tCez6QBpvNu Nrhqgv6cB3BR6yRerggbjKlHlRRTABObRxU9D2divfhPXTsZhbOaWiuPKnQ8xtFZa9fDYP8KvOK XbhJQxZLlhAvByveZCJR4MLB7x6GTfSW0A4fJHaXDQDuzQARNc8xzKgjHIBvJ X-Received: by 2002:a05:600c:4f05:b0:3cf:4818:1704 with SMTP id l5-20020a05600c4f0500b003cf48181704mr16128124wmq.181.1667405502209; Wed, 02 Nov 2022 09:11:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iVLqIC3wL43LWvHOoa8yG/SAgfDjY0ggdZmEnpqIYarsDx/B+PMOQq+AwQr7W45lt9WR52g== X-Received: by 2002:a05:600c:4f05:b0:3cf:4818:1704 with SMTP id l5-20020a05600c4f0500b003cf48181704mr16128083wmq.181.1667405501895; Wed, 02 Nov 2022 09:11:41 -0700 (PDT) Received: from redhat.com ([2.52.15.189]) by smtp.gmail.com with ESMTPSA id n42-20020a05600c502a00b003cf5ec79bf9sm2599943wmr.40.2022.11.02.09.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 09:11:41 -0700 (PDT) Date: Wed, 2 Nov 2022 12:11:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL v2 69/82] hw/i386/acpi-build: Resolve north rather than south bridges Message-ID: <20221102160336.616599-70-mst@redhat.com> References: <20221102160336.616599-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221102160336.616599-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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" @@ -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 = object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + Object *i440fx = object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOST_BRIDGE); + Object *q35 = 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 = { .sig = "DSDT", .rev = 1, .oem_id = x86ms->oem_id, .oem_table_id = x86ms->oem_table_id }; - assert(!!piix != !!lpc); + assert(!!i440fx != !!q35); acpi_table_begin(&table, table_data); dsdt = init_aml_allocator(); build_dbg_aml(dsdt); - if (piix) { + if (i440fx) { sb_scope = aml_scope("_SB"); dev = 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 = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); -- MST