From nobody Mon Feb 9 04:14:54 2026 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+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667221406; cv=none; d=zohomail.com; s=zohoarc; b=VmMZBpGbElhEWBQvb658GKYwUvnL9aYiPtLZY1P9KZJEZE5XtgQGdqrLp4EavumWhaa6w7LYKYp8p5xSMcGDllim1pcntcnzfuwso5D8cEfH+liscxC/4FaYtxiwwIvBmuH/f2pjR5+AJhwkbV6NgOPKGvqscnvbzKhSQ4IOF+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667221406; 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=Gag5gdQNNtInKGqXoAiltRUevA6HG18svJOyxzNtlVk=; b=B2IGWQL1PmAOJbcZYhos+orzgL/UuFoCrFjRBpk+xaLh2o3Pi0ehg9osC4bPZygIMLzSQrxoSOfY20zmWRJHjzakK4Bo3+9LuaiVDYl4yyOoJoaHvEiiZ+y3mdtZNJ+o2xH6MVG8txcCEvyAmW45GP7sjiRyC+Twz+5DgBd9Wpw= 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+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 1667221406513603.0276952536411; Mon, 31 Oct 2022 06:03:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUJJ-0005dV-CM; Mon, 31 Oct 2022 08:54:37 -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 1opUIz-0004YE-Rd for qemu-devel@nongnu.org; Mon, 31 Oct 2022 08:54:17 -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 1opUIx-0003RB-CR for qemu-devel@nongnu.org; Mon, 31 Oct 2022 08:54:16 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-257-6FhFymV8NtunMJ4M7HvyNA-1; Mon, 31 Oct 2022 08:54:12 -0400 Received: by mail-wm1-f72.google.com with SMTP id c5-20020a1c3505000000b003c56da8e894so8325267wma.0 for ; Mon, 31 Oct 2022 05:54:12 -0700 (PDT) Received: from redhat.com ([2.52.15.189]) by smtp.gmail.com with ESMTPSA id bx10-20020a5d5b0a000000b0022e47b57735sm7204086wrb.97.2022.10.31.05.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 05:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667220854; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Gag5gdQNNtInKGqXoAiltRUevA6HG18svJOyxzNtlVk=; b=VNZMd0YpCPcoLiHmPXb2B2ghXK5b5E1P3jFUXfUJ5+QMtA7INT0P0R0J5es5F7LTcOEq9Y 3ySrZTrqoM4RbNaDf8XsXUbFcLgh+sc8rglbPega0UHa150M5rUeo5wP1YbZ6HHdYAwtDb yWtkIsArGFgrTdXvRjaWlax1Ep4vrbM= X-MC-Unique: 6FhFymV8NtunMJ4M7HvyNA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding: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=Gag5gdQNNtInKGqXoAiltRUevA6HG18svJOyxzNtlVk=; b=Tfcno/zg2sWyW3qjOxeM5BzQIk3ZUW7LpzpO7fN+/V8WZ4/nU7FV4VGEsAEO5YJjzx 1fDPMneGQU8oc4vnEBYJJXSP4z1tBtM+kGWrqESgmHJhevb4RGJbBUtH/tlz8Y9NNly/ SS4zGBt74NK10HEJ5JK/o9s4+PonbGa4/lK3RaF5RY6yqyXWhkeq0zxYKD1uZQdKfV8R Fbtdu+fkwk4q7ncwp/T1FtFdSJQwGpObPUzUE6uj5nD8PVt3tYKv9plRsYRmLdwvsU/9 asSV+xe0Wxo11JRL8iRn+B4E6gAHwli6t2oF9w413BIkywzJL1Nq+nzma+IQXi4vv754 4QXQ== X-Gm-Message-State: ACrzQf3WrO3/VMKomy+hvZY0400WWaMQCaawjhNRjbSHdCCXjj3Dmyim 7vXqRcDzgNIWlZbB3OHXmduLM/mw1vBYgbS72PvoX+lUQs7XPxaOFuj5WFrgiRitRWkcZr8G2mU GyT9ZzQu6qN+MvbROTkrUDrOsTLx0s/gMjkBHmTY6R9vT05xk0B4eX7tpfO0G X-Received: by 2002:a5d:564c:0:b0:236:6089:cc50 with SMTP id j12-20020a5d564c000000b002366089cc50mr7692161wrw.520.1667220851239; Mon, 31 Oct 2022 05:54:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5v3c0XAxDEVtehzYs9nA0S4l1WFlKmUhxSKhoNLdkNw/x3oCGy+RPaBkHr1k1PNFW1Z5mIig== X-Received: by 2002:a5d:564c:0:b0:236:6089:cc50 with SMTP id j12-20020a5d564c000000b002366089cc50mr7692136wrw.520.1667220850921; Mon, 31 Oct 2022 05:54:10 -0700 (PDT) Date: Mon, 31 Oct 2022 08:54:08 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 72/86] hw/i386/acpi-build: Resolve redundant attribute Message-ID: <20221031124928.128475-73-mst@redhat.com> References: <20221031124928.128475-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20221031124928.128475-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+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: -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+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667221409290100003 From: Bernhard Beschow 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> Message-Id: <20221028103419.93398-3-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 MST