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 X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A14BC43461 for ; Thu, 17 Sep 2020 07:07:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C75DC206E6 for ; Thu, 17 Sep 2020 07:07:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GQc24V5E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C75DC206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIo0e-0005SD-Pp for qemu-devel@archiver.kernel.org; Thu, 17 Sep 2020 03:07:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kInzk-0004HE-Jp for qemu-devel@nongnu.org; Thu, 17 Sep 2020 03:06:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kInzi-00089f-3v for qemu-devel@nongnu.org; Thu, 17 Sep 2020 03:06:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600326372; 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=H0k3e5CG2TiWg4Y7fkE7oU/8INS1YVOS6UCTV5rXo98=; b=GQc24V5Ei6/bLiSfkZ1kmD6PrZhqcgLWA6wM1vnyOBTgWk6m8H+z/7jg3ghm4VSMqildyl rny2kJsa5id4Gg2irAs3hIY3EhX4fvh8g7+gA2r63o/db4KzG5oWiLHn2hgK7s5zcc+D22 xVNMXYbQw0G9+gmpkFGG1uaThjMbl3A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-qQ1GM4aDOk6W3XQgCwL2zQ-1; Thu, 17 Sep 2020 03:06:08 -0400 X-MC-Unique: qQ1GM4aDOk6W3XQgCwL2zQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B156801AB9; Thu, 17 Sep 2020 07:06:07 +0000 (UTC) Received: from localhost (unknown [10.43.2.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFA4A60BE5; Thu, 17 Sep 2020 07:05:58 +0000 (UTC) Date: Thu, 17 Sep 2020 09:05:57 +0200 From: Igor Mammedov To: Ani Sinha Subject: Re: [PATCH v5 09/11] piix4: don't reserve hw resources when hotplug is off globally Message-ID: <20200917090557.4c1c9bf3@redhat.com> In-Reply-To: References: <20200916081910.977-1-ani@anisinha.ca> <20200916081910.977-10-ani@anisinha.ca> <20200917081602.7c2ff36f@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=63.128.21.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/16 20:51:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -50 X-Spam_score: -5.1 X-Spam_bar: ----- X-Spam_report: (-5.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-2.999, 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_H5=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , Julia Suvorova , Philippe =?UTF-8?B?TWF0aGlldS1EYXVk?= =?UTF-8?B?w6k=?= , QEMU Developers , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, 17 Sep 2020 12:09:46 +0530 Ani Sinha wrote: > On Thu, Sep 17, 2020 at 11:46 AM Igor Mammedov wrote: > > > > On Wed, 16 Sep 2020 13:49:08 +0530 > > Ani Sinha wrote: > > > > > When acpi hotplug is turned off for both root pci bus as well as for pci > > > bridges, we should not generate the related acpi code for DSDT table or > > > initialize related hw ports or reserve hw resources. This change makes > > > sure all those operations are turned off in the case acpi pci hotplug is > > > off globally. > > > > > > In this change, we also make sure AMLs for the PCNT method are only added when > > > bsel is enabled for the corresponding pci bus or bridge hotplug is turned on. > > > As a result, when the hotplug for both the root pci device and bridge are > > > disabled, this AML in the DSDT acpi table is turned off. > > > > > > As q35 machines do not use bsel for it's pci buses at this point in time, this > > > change affects DSDT acpi table for q35 machines as well. Therefore, we also > > > commit the updated golden master DSDT table acpi binary blobs as well. > > > > Please split binary blobs into separate patch, as described in process. > > Otherwise the patch is very likely to become un-merge-able due to conflicts. > > I wanted to make sure that the changes in this patch and the blobs go > together as a single atomic commit since the unit test will break if > one has the patch but not the blobs. it would work if it were the only patch that touches ACPI, process instructs splitting acpi changes in 3 part to avoid issues with merging and bisecting. (it saves time not only of maintainer but your as well) Additionally, one can not review (without going into trouble of testing/disassembling) binary blobs, so it's good to split them out into a separate patch. > > > > > Following is a typical diff between the q35 acpi DSDT table blobs: > > > > > > @@ -1,30 +1,30 @@ > > > /* > > > * Intel ACPI Component Architecture > > > * AML/ASL+ Disassembler version 20180105 (64-bit version) > > > * Copyright (c) 2000 - 2018 Intel Corporation > > > * > > > * Disassembling to symbolic ASL+ operators > > > * > > > - * Disassembly of tests/data/acpi/q35/DSDT, Tue Sep 15 18:52:47 2020 > > > + * Disassembly of /tmp/aml-3O0DR0, Tue Sep 15 18:52:47 2020 > > > * > > > * Original Table Header: > > > * Signature "DSDT" > > > - * Length 0x00001DFE (7678) > > > + * Length 0x00001DF6 (7670) > > > * Revision 0x01 **** 32-bit table (V1), no 64-bit math support > > > - * Checksum 0xAC > > > + * Checksum 0x17 > > > * OEM ID "BOCHS " > > > * OEM Table ID "BXPCDSDT" > > > * OEM Revision 0x00000001 (1) > > > * Compiler ID "BXPC" > > > * Compiler Version 0x00000001 (1) > > > */ > > > DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPCDSDT", 0x00000001) > > > { > > > Scope (\) > > > { > > > OperationRegion (DBG, SystemIO, 0x0402, One) > > > Field (DBG, ByteAcc, NoLock, Preserve) > > > { > > > DBGB, 8 > > > } > > > > > > @@ -3113,24 +3113,20 @@ > > > Name (_ADR, 0x00010000) // _ADR: Address > > > Method (_S1D, 0, NotSerialized) // _S1D: S1 Device State > > > { > > > Return (Zero) > > > } > > > > > > Method (_S2D, 0, NotSerialized) // _S2D: S2 Device State > > > { > > > Return (Zero) > > > } > > > > > > Method (_S3D, 0, NotSerialized) // _S3D: S3 Device State > > > { > > > Return (Zero) > > > } > > > } > > > - > > > - Method (PCNT, 0, NotSerialized) > > > - { > > > - } > > > } > > > } > > > } > > > > > > Signed-off-by: Ani Sinha > > > --- > > > hw/acpi/piix4.c | 6 ++++-- > > > hw/i386/acpi-build.c | 25 ++++++++++++++++++------- > > > tests/data/acpi/q35/DSDT | Bin 7678 -> 7670 bytes > > > tests/data/acpi/q35/DSDT.acpihmat | Bin 9002 -> 8994 bytes > > > tests/data/acpi/q35/DSDT.bridge | Bin 7695 -> 7688 bytes > > > tests/data/acpi/q35/DSDT.cphp | Bin 8141 -> 8133 bytes > > > tests/data/acpi/q35/DSDT.dimmpxm | Bin 9331 -> 9323 bytes > > > tests/data/acpi/q35/DSDT.ipmibt | Bin 7753 -> 7745 bytes > > > tests/data/acpi/q35/DSDT.memhp | Bin 9037 -> 9029 bytes > > > tests/data/acpi/q35/DSDT.mmio64 | Bin 8808 -> 8801 bytes > > > tests/data/acpi/q35/DSDT.numamem | Bin 7684 -> 7676 bytes > > > tests/data/acpi/q35/DSDT.tis | Bin 8283 -> 8276 bytes > > > 12 files changed, 22 insertions(+), 9 deletions(-) > > > > > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > > > index e6163bb6ce..b70b1f98af 100644 > > > --- a/hw/acpi/piix4.c > > > +++ b/hw/acpi/piix4.c > > > @@ -596,8 +596,10 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, > > > "acpi-gpe0", GPE_LEN); > > > memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe); > > > > > > - acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, > > > - s->use_acpi_hotplug_bridge); > > > + if (s->use_acpi_hotplug_bridge || s->use_acpi_root_pci_hotplug) { > > > + acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, > > > + s->use_acpi_hotplug_bridge); > > > + } > > > > > > s->cpu_hotplug_legacy = true; > > > object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > > index e079b686f5..e41bb0992b 100644 > > > --- a/hw/i386/acpi-build.c > > > +++ b/hw/i386/acpi-build.c > > > @@ -95,6 +95,7 @@ typedef struct AcpiPmInfo { > > > bool s3_disabled; > > > bool s4_disabled; > > > bool pcihp_bridge_en; > > > + bool pcihp_root_en; > > > uint8_t s4_val; > > > AcpiFadtData fadt; > > > uint16_t cpu_hp_io_base; > > > @@ -245,6 +246,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) > > > pm->pcihp_bridge_en = > > > object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support", > > > NULL); > > > + pm->pcihp_root_en = > > > + object_property_get_bool(obj, "acpi-root-pci-hotplug", > > > + NULL); > > > } > > > > > > static void acpi_get_misc_info(AcpiMiscInfo *info) > > > @@ -450,10 +454,12 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, > > > } > > > > > > /* Append PCNT method to notify about events on local and child buses. > > > - * Add unconditionally for root since DSDT expects it. > > > + * Add this method for root bus only when hotplug is enabled since DSDT > > > + * expects it. > > > */ > > > - method = aml_method("PCNT", 0, AML_NOTSERIALIZED); > > > - > > > + if (bsel || pcihp_bridge_en) { > > > + method = aml_method("PCNT", 0, AML_NOTSERIALIZED); > > > + } > > > /* If bus supports hotplug select it and notify about local events */ > > > if (bsel) { > > > uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel)); > > > @@ -479,7 +485,10 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, > > > aml_append(method, aml_name("^S%.02X.PCNT", devfn)); > > > } > > > } > > > - aml_append(parent_scope, method); > > > + > > > + if (bsel || pcihp_bridge_en) { > > > + aml_append(parent_scope, method); > > > + } > > > qobject_unref(bsel); > > > } > > > > > > @@ -1504,7 +1513,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > > build_hpet_aml(dsdt); > > > build_piix4_isa_bridge(dsdt); > > > build_isa_devices_aml(dsdt); > > > - build_piix4_pci_hotplug(dsdt); > > > + if (pm->pcihp_bridge_en || pm->pcihp_root_en) { > > > + build_piix4_pci_hotplug(dsdt); > > > + } > > > build_piix4_pci0_int(dsdt); > > > } else { > > > sb_scope = aml_scope("_SB"); > > > @@ -1546,7 +1557,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > > { > > > aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006"))); > > > > > > - if (misc->is_piix4) { > > > + if (misc->is_piix4 && (pm->pcihp_bridge_en || pm->pcihp_root_en)) { > > > method = aml_method("_E01", 0, AML_NOTSERIALIZED); > > > aml_append(method, > > > aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF)); > > > @@ -1698,7 +1709,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > > crs_range_set_free(&crs_range_set); > > > > > > /* reserve PCIHP resources */ > > > - if (pm->pcihp_io_len) { > > > + if (pm->pcihp_io_len && (pm->pcihp_bridge_en || pm->pcihp_root_en)) { > > > dev = aml_device("PHPR"); > > > aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06"))); > > > aml_append(dev, > > > diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT > > > index bba8884073a27427b88ac0d733c9c87330a59366..4fad91b72e279b744b0528fd687c862d3a3d5cfa 100644 > > > GIT binary patch > > > delta 33 > > > pcmexo{mq)oCD > > > > > delta 42 > > > ycmexn{m+`qCD > > > > > diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat > > > index 9cac92418b5fcc2767dc74603d599642b59623fe..e4df7d1ca89578dd81be3539c8f83f073bb8db25 100644 > > > GIT binary patch > > > delta 33 > > > pcmZ4Gw#bdkCDEHUxHPVoYElb > > > > > delta 42 > > > xcmZ4Fw#tpmCD > > > > > diff --git a/tests/data/acpi/q35/DSDT.bridge b/tests/data/acpi/q35/DSDT.bridge > > > index f08b7245f59aad491fcaa60e2bab1085c369ea1c..065399174575442201cc09ffa4939ddf90ac81b4 100644 > > > GIT binary patch > > > delta 33 > > > ocmeCT>9FB)33dtLkYiwAT)&ZPnJlLVYfOBwQ@nt~ > > > > > delta 41 > > > wcmeCM>9^r>33dtLmt$aH^xnv|OqSE1H6}jTDPF*R@=jTQb`iD!XTJ~z0NaZSF#rGn > > > > > > diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp > > > index 57d859cef9fa16a8f125c4b338611c8472699f38..8d2395e3cb4383b30e3840caed0d09ccad0c7323 100644 > > > GIT binary patch > > > delta 33 > > > ocmX?Wf7G7KCDY0kO^r)&Kwi > > > > > > delta 42 > > > xcmX?Vf7YJMCDvmYDcpr+5K3mdPFRw(KHo0nUCQ3;+bB3f%wz > > > > > > diff --git a/tests/data/acpi/q35/DSDT.dimmpxm b/tests/data/acpi/q35/DSDT.dimmpxm > > > index 9d5bd5744e2ba2e0f6126c3aba0bb36af865e499..df7422051c6feadeaa3b6733ad7efa67c339b49d 100644 > > > GIT binary patch > > > delta 33 > > > ocmezD@!EsSCD)i9v > > > > > delta 42 > > > xcmaFu@!5mRCD > > > > > diff --git a/tests/data/acpi/q35/DSDT.ipmibt b/tests/data/acpi/q35/DSDT.ipmibt > > > index 5cd11de6a8fe47324e5f922823a22746882f19f5..c4ce5cc0ede822ea82656d078d7a8b7eee4a7516 100644 > > > GIT binary patch > > > delta 33 > > > ocmX?UbI^v%CD > > > > > delta 42 > > > xcmX?TbJB*(CD > > > > > diff --git a/tests/data/acpi/q35/DSDT.memhp b/tests/data/acpi/q35/DSDT.memhp > > > index 05a7a73ec43130d5c3018bb462fd84981bfb151c..84614ffc1452358053b4c2be4b2edcb4d56a9ae6 100644 > > > GIT binary patch > > > delta 33 > > > ocmX@>cGQi_CDc=Kufz > > > > > > delta 42 > > > xcmX@=cGiu{CD^ > > > > > > diff --git a/tests/data/acpi/q35/DSDT.mmio64 b/tests/data/acpi/q35/DSDT.mmio64 > > > index efd3f1188f2b55da1514212d4be081a61c2a96e9..d8dd702b69cc24a6b58b8eaa79ea02439a2a7dd9 100644 > > > GIT binary patch > > > delta 33 > > > ocmaFi^3a9LCD > > > > > delta 41 > > > wcmaFp^1_A7CD)i>_Ld&VC^b00^lI82|tP > > > > > > diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.numamem > > > index 1978b55f1255402bf9bade0b91150b5cb49789a4..f36d22063a6eed4fb107ffd0e10477a2d6d7a983 100644 > > > GIT binary patch > > > delta 33 > > > pcmZp%`D4xH66_N4N0xzs@!&?THL{#;EHUxHPVoYElMl$+0sy+k3XK2& > > > > > > delta 42 > > > xcmexk-D1P#66_MfBFDhM7`l;bjVzZROH6#QQ@ns1%jEsCw(KHo0nUCQ3;^@W3X}i< > > > > > > diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis > > > index 638de3872673d17b1958497d0e62c83653de1602..203030a61a92c204bb93c43fe79e546471ae2985 100644 > > > GIT binary patch > > > delta 38 > > > ucmccZaK(YkCDUZRU~-WC8&31`DbH > > > > > > delta 45 > > > zcmccOaNB{)CD > > B45 > > > > >