From patchwork Wed Oct 26 13:31:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13020643 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 A556AC433FE for ; Wed, 26 Oct 2022 13:39:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ongVr-0005w9-3E; Wed, 26 Oct 2022 09:32:07 -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 1ongVp-0005rN-Of; Wed, 26 Oct 2022 09:32:05 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ongVh-0007kS-UE; Wed, 26 Oct 2022 09:31:59 -0400 Received: by mail-ed1-x533.google.com with SMTP id y69so22461290ede.5; Wed, 26 Oct 2022 06:31:57 -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=bRfDr5SFILAQcnsuAkN6VzuhG0H6yTFDwJWwXL/GynY=; b=FmsF2UVwdnc/mS/3njy3a6RJSKAnIzpmo6/9ESVaNKemGvFIVBopRwgOyz9AoqmXqg +Z1OuyJqGcl3RvEmwUhUo1kevgFaPVlMbiC00eoWlnJ3FwxjwJOxv8XL2inOMW8hQCoL qNnuTzmIdeixB3efqB2anZGILcYNvYP9DZSJDC+Zx6u1wyDuM8ZcQG/fmUVteldyd0vl j2iIosGR5Kcahf/QW1CTd7cK6SRTLea5HegtlwSC98gCWBlM0x2Y3BJCpfF3IB4CBunG eSgzSqe+rWc1EbRbhKUcuXkz32AqLV6Q5Qo42NdiHj50rxaW+uYMlwI1XUhrfMN2u+pJ Z4kA== 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=bRfDr5SFILAQcnsuAkN6VzuhG0H6yTFDwJWwXL/GynY=; b=Wm+3uuedvGQCGvUhknEC92o79NVBNGZqoDEWWaF3pgatlvoawkGLLQrr49AQAUy9tc D0P94VwqrylLYlivHjMMM9PSPnHxJ9akVtQ85fX/91WYv/urLFwlZAcK5o/+hdUGr31W ZiaJozs6lYcK16BVypsP4wC7bCIdIhsqZYzIckPficsjb5uhDsQ+srxEq74P4JSK5gmZ GiuubC1miDJc5YW1nUzLxkshbvyIQ0LKOpxXrnomtpgdNXwvbT7F572M+rUPM3krtjAV +zQft8xy4aEofBjOe2loi4VIrhw8pBERDeGuycmo16t4UBqa3O4e1TLtvRNIkO/Uo+gx XjEA== X-Gm-Message-State: ACrzQf1jkFpg4Oms4EktFgsgBvALE6iyAQzvDshHUSK8zjRDqBO6W9ti ni4ay3Xw1DX8Bn8fgMHsWFnUnU31jSo= X-Google-Smtp-Source: AMsMyM67G9ljArt/DT1NpfMccJozz9hcw/K6ql+Ds1OE0V0sGU0FKIzmizR36hm1qvYdxfX+V9hABA== X-Received: by 2002:aa7:de81:0:b0:461:2122:a807 with SMTP id j1-20020aa7de81000000b004612122a807mr29775585edv.382.1666791115855; Wed, 26 Oct 2022 06:31:55 -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 13-20020a170906328d00b00730b3bdd8d7sm3032524ejw.179.2022.10.26.06.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:31:55 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , qemu-trivial@nongnu.org, Ani Sinha , Igor Mammedov , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Bernhard Beschow Subject: [PATCH 1/4] hw/i386/acpi-build: Remove unused struct Date: Wed, 26 Oct 2022 15:31:07 +0200 Message-Id: <20221026133110.91828-2-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221026133110.91828-1-shentey@gmail.com> References: <20221026133110.91828-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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+qemu-devel=archiver.kernel.org@nongnu.org Ammends commit b23046abe78f48498a423b802d6d86ba0172d57f 'pc: acpi-build: simplify PCI bus tree generation'. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- 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 4f54b61904..b4d9a05760 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -121,13 +121,6 @@ typedef struct AcpiMiscInfo { unsigned dsdt_size; } AcpiMiscInfo; -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; From patchwork Wed Oct 26 13:31:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13020650 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 63956C433FE for ; Wed, 26 Oct 2022 13:41:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ongVv-0005x4-9H; Wed, 26 Oct 2022 09:32:11 -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 1ongVr-0005wI-Ce; Wed, 26 Oct 2022 09:32:07 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ongVp-0007km-Qa; Wed, 26 Oct 2022 09:32:07 -0400 Received: by mail-ej1-x629.google.com with SMTP id b2so21280344eja.6; Wed, 26 Oct 2022 06:31:59 -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=HxXdl7oEF+i6qVetlrC96ePVGZivy2YPeOTXA2wfdQw=; b=djAFXNHsRZNdgTLlZZyAl1kAC9+IKkmhG7NKQLKLs/X9+/dMnE6/GJQja0d3oZEcYE lMT1xTVsGpm1HhaIbfWUOwWgMX10DamRGmyPEiJl9wEmQHcgJIV2GA6R+9k9GTaY5+vd E/mG0hlLyBzMcrKXr16jlgvac9+vmyvDLDAUwJs28YqrxT8ZnUZbCzSixUzUjCsCKWYE WXJSkz4RdF8qy90HN1a3OjJyMxi9nm6mhxX+TnKZPSmAHortwGlv6xyUu8fRtQrNxleO 9w15rgx79eaeeYTlcm1u9ZOYzabQ36mdIyxz0oblBQmSwH6Hc7wsAMnDeGlnJ04lOkjL aqjA== 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=HxXdl7oEF+i6qVetlrC96ePVGZivy2YPeOTXA2wfdQw=; b=zz4FUT2fcOklB5kvUEhFA4DmFOT34slEuN8zcVh3vzigyR7wBiYrcy1cp7+F65D4Hu qc1IxWEEKJ+0FbtJzt3QE2tVtCdzNYpOmzqu4z5XeuLrweV+YDuuaJfZ5dILBHFR4FZX Ve/dqybf08GzkOOL3lXX4pir3MhcTVHhoLzyWjApPzPkFuTemaTaRwEBYWjDLoEh/je+ D5YFoUzFeZ0+n8VhJhMCtSUU81+eVjzvTB4oNF0UgqKk37V4xS3ngeSv8gKUwsCRAfG/ 7IaOyxNrcDpjPYziBHDfFs0635V3mXx0/9hGkqRy6C6qHfCdwq7vqVqCjh2CBqBO9iQ+ J9BA== X-Gm-Message-State: ACrzQf3pMPR25qDuukMV/FSS/xwg4KHZ39R8C0MkzEUCS1OAgZn3Y6ae Vbma0nIaRG1HyO7JWo+8NUasfIGU5VE= X-Google-Smtp-Source: AMsMyM7i/q8y+1ihWhoMlIXTo0Dt/petsbX3Sm/NBFwVkZ4R9sn4NnFmJCiSqwKufZYZxW+viz9C+Q== X-Received: by 2002:a17:907:2da5:b0:78e:1208:8783 with SMTP id gt37-20020a1709072da500b0078e12088783mr37981670ejc.743.1666791116845; Wed, 26 Oct 2022 06:31:56 -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 13-20020a170906328d00b00730b3bdd8d7sm3032524ejw.179.2022.10.26.06.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:31:56 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , qemu-trivial@nongnu.org, Ani Sinha , Igor Mammedov , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Bernhard Beschow Subject: [PATCH 2/4] hw/i386/acpi-build: Resolve redundant attribute Date: Wed, 26 Oct 2022 15:31:08 +0200 Message-Id: <20221026133110.91828-3-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221026133110.91828-1-shentey@gmail.com> References: <20221026133110.91828-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.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+qemu-devel=archiver.kernel.org@nongnu.org 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é --- 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 b4d9a05760..f3131fee60 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -112,7 +112,6 @@ typedef struct AcpiPmInfo { } AcpiPmInfo; 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, AcpiPmInfo *pm) static void acpi_get_misc_info(AcpiMiscInfo *info) { - Object *piix = object_resolve_type_unambiguous(TYPE_PIIX4_PM); - Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); - assert(!!piix != !!lpc); - - if (piix) { - info->is_piix4 = true; - } - if (lpc) { - info->is_piix4 = false; - } - info->has_hpet = hpet_find(); #ifdef CONFIG_TPM info->tpm_version = tpm_get_version(tpm_find()); @@ -1449,6 +1437,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 *ich9 = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; CrsRangeSet crs_range_set; @@ -1469,11 +1459,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 != !!ich9); + acpi_table_begin(&table, table_data); dsdt = init_aml_allocator(); build_dbg_aml(dsdt); - if (misc->is_piix4) { + if (piix) { sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); @@ -1487,7 +1479,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 (ich9) { sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); From patchwork Wed Oct 26 13:31:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13020642 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 C044EC433FE for ; Wed, 26 Oct 2022 13:36:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ongVw-00061I-2o; Wed, 26 Oct 2022 09:32:12 -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 1ongVr-0005wS-EJ; Wed, 26 Oct 2022 09:32:07 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ongVp-0007kg-QM; Wed, 26 Oct 2022 09:32:07 -0400 Received: by mail-ej1-x629.google.com with SMTP id n12so15883447eja.11; Wed, 26 Oct 2022 06:31:59 -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=XESKMVuDJz1jSX+WNV/9oFJ+H18ldQPYmRy83zJGAK8=; b=B4Gh2BRkaws7d2XQCmo/Mwfm+WlFiB81c2DX7iLGVa9eUIH4NzI87sVoWEExi/WMDy Uh3coFmBGU340I79lldUVx+/wn1IokvJrhA5kMe4gvVG91Z9MYWnqgtaRhwxR/taRI30 /FedRS4mYnritGTdNeVv+qdugowqA19weVlSS7TvRj2qzh7HIhAjTmJ8xK1RUKjXz38K 8QGpdUPnGBK5mQNjJaG0JjDTC+1sAe7hM3ezR+9E9x8Xmt9oMr9uZItjKrjw/cCx0tdb w6tOK99T4A/yTMd/7AZ16mre52J+yObSEbV2j7vm1O/oVLGKFxDKWM0cBWDItn6v2kYA epYw== 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=XESKMVuDJz1jSX+WNV/9oFJ+H18ldQPYmRy83zJGAK8=; b=X1LH2igdDvCerF6/ZdoGyGqRyKooFwWqQk4LaH6JSWWIG4JF48yrUk/XP2zEilL/or TPvTFH2nZdUIa6qATUbp9GUbXGdeng60nz9km+Z2dUKFB3quIL5bGBj1n50nENguEuVt RTmPQmlsd6Bcs87nT2pZvyqAAv/UYLn+0fMM459LmxfEQqet80th5fXYYPgqPShp3XgB n3luo/IIeWyUrou/BCRDqIX3NK9PCrUK/bQubCMoJ5zX7ccD7pNQD2Qf6rTj29tzAF+k dUmZ9Li8950qYm4KZwHF5wmfSizcOZrUyInz50u3gCsYDLmZFTuwXerJe95zftfhXY+P lDEA== X-Gm-Message-State: ACrzQf3eAChwnfLllrldP+ygSPa+nGADaK8ABrf1u931sDRjzSYU0ua3 s666sF82JYpkGyfTY/P7eo0BG/SDYGo= X-Google-Smtp-Source: AMsMyM5JjYPZPlVGLT+9YPVxSrIcNhKGGofjgRx9c+69yB/68RAR6BG9MfLF1sXgQZuzeqqVWwkO+w== X-Received: by 2002:a17:907:75c6:b0:79c:d3f4:4a14 with SMTP id jl6-20020a17090775c600b0079cd3f44a14mr24181628ejc.61.1666791117846; Wed, 26 Oct 2022 06:31:57 -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 13-20020a170906328d00b00730b3bdd8d7sm3032524ejw.179.2022.10.26.06.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:31:57 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , qemu-trivial@nongnu.org, Ani Sinha , Igor Mammedov , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Bernhard Beschow Subject: [PATCH 3/4] hw/i386/acpi-build: Resolve PIIX ISA bridge rather than ACPI controller Date: Wed, 26 Oct 2022 15:31:09 +0200 Message-Id: <20221026133110.91828-4-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221026133110.91828-1-shentey@gmail.com> References: <20221026133110.91828-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.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+qemu-devel=archiver.kernel.org@nongnu.org Resolving the PIIX ISA bridge rather than the PIIX ACPI controller mirrors the ICH9 code one line below. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f3131fee60..f0a20c8b21 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1437,7 +1437,7 @@ 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 *piix = object_resolve_type_unambiguous(TYPE_PIIX3_PCI_DEVICE); Object *ich9 = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; From patchwork Wed Oct 26 13:31:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13020645 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 28CB5C38A2D for ; Wed, 26 Oct 2022 13:41:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ongVx-00064g-22; Wed, 26 Oct 2022 09:32:13 -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 1ongVs-0005x1-Mt; Wed, 26 Oct 2022 09:32:08 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ongVp-0007kx-Rq; Wed, 26 Oct 2022 09:32:08 -0400 Received: by mail-ed1-x535.google.com with SMTP id a67so41441511edf.12; Wed, 26 Oct 2022 06:32:00 -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=sxDRbgVA64cXKgk3YgNb+L46+FS+6e7D3e8U1RBDU4w=; b=FV0NkI61Kgpnj3y5oi2vS+Fv0pXbnA+9ZovE5nlZZJ4rXejV9SR8SgZz+utXqjtQr0 x2LP03EdPHwpk3UpP/0SdzCmlYjKWcI1WRd8P9E9ViYeCiJtXdvJpskmboL4CiQvbNb9 Jv8h84R3vF1baKuBQar+/sBQxsoVlVwPz57ar4s/AzLuKGoAfv8cnj0UU0iNQ4ID5fQE 52wI7qa/qJddgm/BwHJYEdpM9el+UeLZeZ/XeshdLOPryFHMHLjd6yZffQ8uINqqsjHq j3AM1jCwb3cIxy7na0gbf164ctGJKkePCq68UsYorPOkF3V0ye4tlVerG59by3eJx3pj i8nQ== 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=sxDRbgVA64cXKgk3YgNb+L46+FS+6e7D3e8U1RBDU4w=; b=dKRwuEUxunKnZHmrCjhhxl788ah/V3RhId+mEdvBqK9M5N/77BpfjI4nOhk+PM3DND 424NPmnmZ+JyYJUxEBuvhZCVzvkFYOBOvt6z6WSb8SHrFi0QgSbUQCFS2jVTmzFxin/O AkH6O5aT62Y+9y9CLnMb/Q0qMe9FfUiIETCJbrsCs6sGc+wLk8mV+6M4D4+MzA80M3kn axM5BhLTQ9l9xF3siE46r0nCX3LqMQjWWOJ3yt0GnZ4PdcXTz/5HSVpL7xNqTkVYfHFv itOfwOmX2EPgfaRJ5CUJT47G7GD75wTIv429pp1yeOph+8V+dWHtsPvuafVAy0zd7D0I xtSw== X-Gm-Message-State: ACrzQf08VscCFwohUlMQOSaOKVZnHO3+wW2iURDIl8F6y4UpgIL71dF9 lyj9eRZelJ6W5bhro9FMD8IzZFt7Eds= X-Google-Smtp-Source: AMsMyM4Rh6YSxzRrJC3z7r81u6bNfmpQ19kabqvR1fmbTwSikVHb9p/ztJS8nzT1qkVnI7aC3NHc6g== X-Received: by 2002:a05:6402:1e8d:b0:454:79a9:201f with SMTP id f13-20020a0564021e8d00b0045479a9201fmr41615767edf.176.1666791119070; Wed, 26 Oct 2022 06:31:59 -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 13-20020a170906328d00b00730b3bdd8d7sm3032524ejw.179.2022.10.26.06.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:31:58 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , qemu-trivial@nongnu.org, Ani Sinha , Igor Mammedov , Richard Henderson , Eduardo Habkost , Paolo Bonzini , Bernhard Beschow Subject: [PATCH 4/4] hw/i386/acpi-build: Generate AML for north and south bridges separately Date: Wed, 26 Oct 2022 15:31:10 +0200 Message-Id: <20221026133110.91828-5-shentey@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221026133110.91828-1-shentey@gmail.com> References: <20221026133110.91828-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=shentey@gmail.com; helo=mail-ed1-x535.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+qemu-devel=archiver.kernel.org@nongnu.org The code currently assumes Q35 iff ICH9 and i440fx iff PIIX. This is slightly confusing when trying to understand the code. Split north and south bridge code to communicate which piece of code assumes which type of bridge. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/acpi-build.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f0a20c8b21..8fbe223d08 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" @@ -1437,6 +1438,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, Range *pci_hole, Range *pci_hole64, MachineState *machine) { + Object *i440fx = object_resolve_type_unambiguous(TYPE_I440FX_PCI_HOST_BRIDGE); + Object *q35 = object_resolve_type_unambiguous(TYPE_Q35_HOST_DEVICE); Object *piix = object_resolve_type_unambiguous(TYPE_PIIX3_PCI_DEVICE); Object *ich9 = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); CrsRangeEntry *entry; @@ -1459,13 +1462,14 @@ 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(!!i440fx != !!q35); assert(!!piix != !!ich9); 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"))); @@ -1473,13 +1477,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dev, aml_name_decl("_UID", aml_int(pcmc->pci_root_uid))); aml_append(sb_scope, dev); aml_append(dsdt, sb_scope); - - build_piix4_isa_bridge(dsdt); - if (pm->pcihp_bridge_en || pm->pcihp_root_en) { - build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); - } - build_piix4_pci0_int(dsdt); - } else if (ich9) { + } else if (q35) { sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); @@ -1518,7 +1516,15 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } aml_append(dsdt, sb_scope); + } + if (piix) { + build_piix4_isa_bridge(dsdt); + if (pm->pcihp_bridge_en || pm->pcihp_root_en) { + build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); + } + build_piix4_pci0_int(dsdt); + } else if (ich9) { build_q35_isa_bridge(dsdt); if (pm->pcihp_bridge_en) { build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);