From patchwork Thu Sep 24 07:00:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 272904 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 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 A87A2C4346E for ; Thu, 24 Sep 2020 07:03:31 +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 15D532388A for ; Thu, 24 Sep 2020 07:03:31 +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="aMl57rKC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15D532388A 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]:50780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLHu-0003BW-3I for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLF8-0000Z2-VW for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLF6-0005H2-V0 for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930835; 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=JQLMvXv0mUTil+NTyNbK8XITxK8lzlUehkO/ZxdRbFw=; b=aMl57rKCQH5JDVitz8GwMjj85yGpR1I/iOhJxw3Doi3EYziXYTs0FRmUFgxcBMWg35t5hX xXJD6/L4WbOVgt39in9ZcuEAQFf7Guiot8QZ+xJiK9dXohZw9lxZaT53O9ySVHw3vLEtXh 3o5LavSkx07qxH9eHjyFP65vwzAREls= 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-534-F3VBvfzJN9yoivFLgfIQag-1; Thu, 24 Sep 2020 03:00:33 -0400 X-MC-Unique: F3VBvfzJN9yoivFLgfIQag-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 C383510BBED7; Thu, 24 Sep 2020 07:00:32 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1192573668; Thu, 24 Sep 2020 07:00:30 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 1/7] hw/acpi/pcihp: Enhance acpi_pcihp_disable_root_bus() to support Q35 Date: Thu, 24 Sep 2020 09:00:07 +0200 Message-Id: <20200924070013.165026-2-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/24 01:10:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" PCI Express does not allow hot-plug on pcie.0. Check for Q35 in acpi_pcihp_disable_root_bus() to be able to forbid hot-plug using the 'acpi-root-pci-hotplug' flag. Signed-off-by: Julia Suvorova Reviewed-by: Igor Mammedov --- hw/acpi/pcihp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 39b1f74442..ff23104aea 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -107,13 +107,14 @@ static void acpi_set_pci_info(void) static void acpi_pcihp_disable_root_bus(void) { static bool root_hp_disabled; + Object *host = acpi_get_i386_pci_host(); PCIBus *bus; if (root_hp_disabled) { return; } - bus = find_i440fx(); + bus = PCI_HOST_BRIDGE(host)->bus; if (bus) { /* setting the hotplug handler to NULL makes the bus non-hotpluggable */ qbus_set_hotplug_handler(BUS(bus), NULL); From patchwork Thu Sep 24 07:00:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 304581 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 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 725F4C4346E for ; Thu, 24 Sep 2020 07:04:45 +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 D16E82388A for ; Thu, 24 Sep 2020 07:04:44 +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="S6MkpSYX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D16E82388A 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]:54364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLJ5-0004dy-TH for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:04:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFB-0000cb-Mw for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLF9-0005HC-8i for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930838; 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=ZQFwmbZ4VN7pHz4afY3coYkBHA9Q3kTDJur7/45jT3U=; b=S6MkpSYXpY/sx/FExkwLi/88imRKjWw8jZr39+4fBjTzi7dQTWHOi+u1GN99ukvxShCq2K r71tLVHBIi8PBhbDYR1I+Kk4+4KeUCCCY6w0I7Ui1pKnoRKL0c1ZbAD/iF2AAra1b7fwW1 e+GRJE/zVJQpoqM7+q8QaAWLG8ZWi14= 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-582-3TQS8U39O5m6Xhy5BsBOFQ-1; Thu, 24 Sep 2020 03:00:36 -0400 X-MC-Unique: 3TQS8U39O5m6Xhy5BsBOFQ-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 943FD807341; Thu, 24 Sep 2020 07:00:35 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBFF173668; Thu, 24 Sep 2020 07:00:33 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 2/7] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35 Date: Thu, 24 Sep 2020 09:00:08 +0200 Message-Id: <20200924070013.165026-3-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/24 01:10:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement notifications and gpe to support q35 ACPI PCI hot-plug. Use 0xcc4 - 0xcd7 range for 'acpi-pci-hotplug' io ports. Signed-off-by: Julia Suvorova --- hw/i386/acpi-build.h | 4 ++++ include/hw/acpi/ich9.h | 2 ++ include/hw/acpi/pcihp.h | 3 ++- hw/acpi/pcihp.c | 8 ++++---- hw/acpi/piix4.c | 4 +++- hw/i386/acpi-build.c | 27 ++++++++++++++++----------- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 74df5fc612..487ec7710f 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi-build.h @@ -5,6 +5,10 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio; +/* PCI Hot-plug registers bases. See docs/spec/acpi_pci_hotplug.txt */ +#define ACPI_PCIHP_SEJ_BASE 0x8 +#define ACPI_PCIHP_BNMR_BASE 0x10 + void acpi_setup(void); #endif diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 28a53181cb..4d19571ed7 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -28,6 +28,8 @@ #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/tco.h" +#define ACPI_PCIHP_ADDR_ICH9 0x0cc4 + typedef struct ICH9LPCPMRegs { /* * In ich9 spec says that pm1_cnt register is 32bit width and diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index 02f4665767..ce49fb03b9 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -54,7 +54,8 @@ typedef struct AcpiPciHpState { } AcpiPciHpState; void acpi_pcihp_init(Object *owner, AcpiPciHpState *, PCIBus *root, - MemoryRegion *address_space_io, bool bridges_enabled); + MemoryRegion *address_space_io, bool bridges_enabled, + uint16_t io_base); void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index ff23104aea..bb457bc279 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -38,7 +38,6 @@ #include "qom/qom-qobject.h" #include "trace.h" -#define ACPI_PCIHP_ADDR 0xae00 #define ACPI_PCIHP_SIZE 0x0014 #define PCI_UP_BASE 0x0000 #define PCI_DOWN_BASE 0x0004 @@ -381,12 +380,13 @@ static const MemoryRegionOps acpi_pcihp_io_ops = { }; void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus, - MemoryRegion *address_space_io, bool bridges_enabled) + MemoryRegion *address_space_io, bool bridges_enabled, + uint16_t io_base) { s->io_len = ACPI_PCIHP_SIZE; - s->io_base = ACPI_PCIHP_ADDR; + s->io_base = io_base; - s->root= root_bus; + s->root = root_bus; s->legacy_piix = !bridges_enabled; memory_region_init_io(&s->io, owner, &acpi_pcihp_io_ops, s, diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 832f8fba82..a505ab5bcf 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -50,6 +50,8 @@ #define GPE_BASE 0xafe0 #define GPE_LEN 4 +#define ACPI_PCIHP_ADDR_PIIX4 0xae00 + struct pci_status { uint32_t up; /* deprecated, maintained for migration compatibility */ uint32_t down; @@ -597,7 +599,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, 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); + s->use_acpi_hotplug_bridge, ACPI_PCIHP_ADDR_PIIX4); 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 0e0535d2e3..cf503b16af 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -201,10 +201,6 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) /* w2k requires FADT(rev1) or it won't boot, keep PC compatible */ pm->fadt.rev = 1; pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE; - pm->pcihp_io_base = - object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); - pm->pcihp_io_len = - object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); } if (lpc) { struct AcpiGenericAddress r = { .space_id = AML_AS_SYSTEM_IO, @@ -214,6 +210,10 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; } + pm->pcihp_io_base = + object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); + pm->pcihp_io_len = + object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); /* The above need not be conditional on machine type because the reset port * happens to be the same on PIIX (pc) and ICH9 (q35). */ @@ -472,7 +472,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, QLIST_FOREACH(sec, &bus->child, sibling) { int32_t devfn = sec->parent_dev->devfn; - if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) { + if (pci_bus_is_root(sec)) { continue; } @@ -1368,7 +1368,7 @@ static void build_piix4_isa_bridge(Aml *table) aml_append(table, scope); } -static void build_piix4_pci_hotplug(Aml *table) +static void build_x86_pci_hotplug(Aml *table, uint64_t pcihp_addr) { Aml *scope; Aml *field; @@ -1377,20 +1377,22 @@ static void build_piix4_pci_hotplug(Aml *table) scope = aml_scope("_SB.PCI0"); aml_append(scope, - aml_operation_region("PCST", AML_SYSTEM_IO, aml_int(0xae00), 0x08)); + aml_operation_region("PCST", AML_SYSTEM_IO, aml_int(pcihp_addr), 0x08)); field = aml_field("PCST", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS); aml_append(field, aml_named_field("PCIU", 32)); aml_append(field, aml_named_field("PCID", 32)); aml_append(scope, field); aml_append(scope, - aml_operation_region("SEJ", AML_SYSTEM_IO, aml_int(0xae08), 0x04)); + aml_operation_region("SEJ", AML_SYSTEM_IO, + aml_int(pcihp_addr + ACPI_PCIHP_SEJ_BASE), 0x04)); field = aml_field("SEJ", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS); aml_append(field, aml_named_field("B0EJ", 32)); aml_append(scope, field); aml_append(scope, - aml_operation_region("BNMR", AML_SYSTEM_IO, aml_int(0xae10), 0x04)); + aml_operation_region("BNMR", AML_SYSTEM_IO, + aml_int(pcihp_addr + ACPI_PCIHP_BNMR_BASE), 0x04)); field = aml_field("BNMR", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS); aml_append(field, aml_named_field("BNUM", 32)); aml_append(scope, field); @@ -1504,7 +1506,7 @@ 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); + build_x86_pci_hotplug(dsdt, pm->pcihp_io_base); build_piix4_pci0_int(dsdt); } else { sb_scope = aml_scope("_SB"); @@ -1520,6 +1522,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_hpet_aml(dsdt); build_q35_isa_bridge(dsdt); build_isa_devices_aml(dsdt); + if (pm->pcihp_bridge_en) { + build_x86_pci_hotplug(dsdt, pm->pcihp_io_base); + } build_q35_pci0_int(dsdt); if (pcms->smbus && !pcmc->do_not_add_smb_acpi) { build_smb0(dsdt, pcms->smbus, ICH9_SMB_DEV, ICH9_SMB_FUNC); @@ -1546,7 +1551,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) { method = aml_method("_E01", 0, AML_NOTSERIALIZED); aml_append(method, aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF)); From patchwork Thu Sep 24 07:00:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 304580 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 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 0D700C4346E for ; Thu, 24 Sep 2020 07:06:34 +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 7E7A1235F7 for ; Thu, 24 Sep 2020 07:06:33 +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="Wjmt9wsh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E7A1235F7 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]:58648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLKq-0006VB-EY for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFJ-0000ml-VQ for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLFH-0005Hi-UO for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930847; 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=IL7nzAh7Mf9HR3Z9mYJS5y5wKlSwZthpUxqWFbQmTzM=; b=Wjmt9wshxiziH9BGdSn73ClOTUWSstot8pjdNE+bANX60oM9G8yPXb4UMbgpPN0oomGFXx A0aLgpPzvPfZyprNFXMNktijJvXaYVU/U79i/E5kv1iRRyiKwTjNxiMLE2FVfKgkyeNnHF 5d9a1+YPujmGVZEzaWHmBoqEsBXGiuo= 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-133-3SGnW4NzOBiEyHxyYYUmfQ-1; Thu, 24 Sep 2020 03:00:45 -0400 X-MC-Unique: 3SGnW4NzOBiEyHxyYYUmfQ-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 639041008307; Thu, 24 Sep 2020 07:00:44 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A20973668; Thu, 24 Sep 2020 07:00:36 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 3/7] hw/pci/pcie: Do not initialize slot capability if acpihp is used Date: Thu, 24 Sep 2020 09:00:09 +0200 Message-Id: <20200924070013.165026-4-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Instead of changing the hot-plug type in _OSC register, do not initialize the slot capability or set the 'Slot Implemented' flag. This way guest will choose ACPI hot-plug if it is preferred and leave the option to use SHPC with pcie-pci-bridge. Signed-off-by: Julia Suvorova --- hw/i386/acpi-build.h | 2 ++ hw/i386/acpi-build.c | 2 +- hw/pci/pcie.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 487ec7710f..4c5bfb3d0b 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi-build.h @@ -11,4 +11,6 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio; void acpi_setup(void); +Object *object_resolve_type_unambiguous(const char *typename); + #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index cf503b16af..b7811a8912 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -174,7 +174,7 @@ static void init_common_fadt_data(MachineState *ms, Object *o, *data = fadt; } -static Object *object_resolve_type_unambiguous(const char *typename) +Object *object_resolve_type_unambiguous(const char *typename) { bool ambig; Object *o = object_resolve_path_type("", typename, &ambig); diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 5b48bae0f6..c1a082e8b9 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -27,6 +27,8 @@ #include "hw/pci/pci_bus.h" #include "hw/pci/pcie_regs.h" #include "hw/pci/pcie_port.h" +#include "hw/i386/ich9.h" +#include "hw/i386/acpi-build.h" #include "qemu/range.h" //#define DEBUG_PCIE @@ -515,12 +517,26 @@ void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, pcie_cap_slot_push_attention_button(hotplug_pdev); } +static bool acpi_pcihp_enabled(void) +{ + Object *lpc = object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + + return lpc && + object_property_get_bool(lpc, "acpi-pci-hotplug-with-bridge-support", + NULL); + +} + /* pci express slot for pci express root/downstream port PCI express capability slot registers */ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s) { uint32_t pos = dev->exp.exp_cap; + if (acpi_pcihp_enabled()) { + return; + } + pci_word_test_and_set_mask(dev->config + pos + PCI_EXP_FLAGS, PCI_EXP_FLAGS_SLOT); From patchwork Thu Sep 24 07:00:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 272903 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 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 B8BD3C4346E for ; Thu, 24 Sep 2020 07:05:24 +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 027E02395B for ; Thu, 24 Sep 2020 07:05:23 +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="VDWv/GJX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 027E02395B 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]:55336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLJi-00053c-Ow for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:05:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFN-0000rf-Gc for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58007) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLFL-0005I2-6R for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930850; 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=4HsZKWB1ml7V0h856im4DRe/N7mUj7BSaI1tUFfOCkQ=; b=VDWv/GJXmpkXnsqw1ODc3mrp0OklqrpttPPnzMQNvXZWt+fM0dBXyooAK8Z48qSJi6/XFq 5JN8DWpHf6i5w1/hbAv6f0aiG8ak6sKgg5GsrLv9E939LPj9u05igQScfYJtm39pU6P6Q0 j+eIqQCNCi+ya3uCLg7bCjwAncxvkO8= 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-271-JCz1oyE3NkK_1l1L0KYr8g-1; Thu, 24 Sep 2020 03:00:48 -0400 X-MC-Unique: JCz1oyE3NkK_1l1L0KYr8g-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 2DD2410BBEC8; Thu, 24 Sep 2020 07:00:47 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7AC7273668; Thu, 24 Sep 2020 07:00:45 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 4/7] hw/acpi/ich9: Enable ACPI PCI hot-plug Date: Thu, 24 Sep 2020 09:00:10 +0200 Message-Id: <20200924070013.165026-5-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add acpi_pcihp to ich9_pm as part of 'acpi-pci-hotplug-with-bridge-support' option. Set default to false. Signed-off-by: Julia Suvorova --- hw/i386/acpi-build.h | 1 + include/hw/acpi/ich9.h | 3 ++ hw/acpi/ich9.c | 67 ++++++++++++++++++++++++++++++++++++++++++ hw/acpi/pcihp.c | 5 +++- hw/i386/acpi-build.c | 2 +- 5 files changed, 76 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 4c5bfb3d0b..39f143830a 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi-build.h @@ -10,6 +10,7 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio; #define ACPI_PCIHP_BNMR_BASE 0x10 void acpi_setup(void); +Object *acpi_get_i386_pci_host(void); Object *object_resolve_type_unambiguous(const char *typename); diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 4d19571ed7..833e62fefe 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -24,6 +24,7 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/cpu_hotplug.h" #include "hw/acpi/cpu.h" +#include "hw/acpi/pcihp.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/tco.h" @@ -55,6 +56,8 @@ typedef struct ICH9LPCPMRegs { AcpiCpuHotplug gpe_cpu; CPUHotplugState cpuhp_state; + bool use_acpi_hotplug_bridge; + AcpiPciHpState acpi_pci_hotplug; MemHotplugState acpi_memory_hotplug; uint8_t disable_s3; diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6a19070cec..987f23e388 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -218,6 +218,26 @@ static const VMStateDescription vmstate_cpuhp_state = { } }; +static bool vmstate_test_use_pcihp(void *opaque) +{ + ICH9LPCPMRegs *s = opaque; + + return s->use_acpi_hotplug_bridge; +} + +static const VMStateDescription vmstate_pcihp_state = { + .name = "ich9_pm/pcihp", + .version_id = 1, + .minimum_version_id = 1, + .needed = vmstate_test_use_pcihp, + .fields = (VMStateField[]) { + VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, + ICH9LPCPMRegs, + NULL), + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_ich9_pm = { .name = "ich9_pm", .version_id = 1, @@ -239,6 +259,7 @@ const VMStateDescription vmstate_ich9_pm = { &vmstate_memhp_state, &vmstate_tco_io_state, &vmstate_cpuhp_state, + &vmstate_pcihp_state, NULL } }; @@ -260,6 +281,7 @@ static void pm_reset(void *opaque) } pm->smi_en_wmask = ~0; + acpi_pcihp_reset(&pm->acpi_pci_hotplug, true); acpi_update_sci(&pm->acpi_regs, pm->irq); } @@ -298,6 +320,18 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, pm->enable_tco = true; acpi_pm_tco_init(&pm->tco_regs, &pm->io); + if (pm->use_acpi_hotplug_bridge) { + acpi_pcihp_init(OBJECT(lpc_pci), + &pm->acpi_pci_hotplug, + pci_get_bus(lpc_pci), + pci_address_space_io(lpc_pci), + true, + ACPI_PCIHP_ADDR_ICH9); + + qbus_set_hotplug_handler(BUS(pci_get_bus(lpc_pci)), + OBJECT(lpc_pci)); + } + pm->irq = sci_irq; qemu_register_reset(pm_reset, pm); pm->powerdown_notifier.notify = pm_powerdown_req; @@ -369,6 +403,20 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp) s->pm.enable_tco = value; } +static bool ich9_pm_get_acpi_pci_hotplug(Object *obj, Error **errp) +{ + ICH9LPCState *s = ICH9_LPC_DEVICE(obj); + + return s->pm.use_acpi_hotplug_bridge; +} + +static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, + Error **errp) +{ + ICH9LPCState *s = ICH9_LPC_DEVICE(obj); + + s->pm.use_acpi_hotplug_bridge = value; +} void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) { static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN; @@ -377,6 +425,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) pm->disable_s3 = 0; pm->disable_s4 = 0; pm->s4_val = 2; + pm->use_acpi_hotplug_bridge = false; object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, &pm->pm_io_base, OBJ_PROP_FLAG_READ); @@ -400,6 +449,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED, ich9_pm_get_enable_tco, ich9_pm_set_enable_tco); + object_property_add_bool(obj, "acpi-pci-hotplug-with-bridge-support", + ich9_pm_get_acpi_pci_hotplug, + ich9_pm_set_acpi_pci_hotplug); } void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, @@ -407,6 +459,11 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, { ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev); + if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { + acpi_pcihp_device_pre_plug_cb(hotplug_dev, dev, errp); + return; + } + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) && !lpc->pm.acpi_memory_hotplug.is_enabled) error_setg(errp, @@ -432,6 +489,9 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } else { acpi_cpu_plug_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); } + } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { + acpi_pcihp_device_plug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug, + dev, errp); } else { error_setg(errp, "acpi: device plug request for not supported device" " type: %s", object_get_typename(OBJECT(dev))); @@ -452,6 +512,10 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, !lpc->pm.cpu_hotplug_legacy) { acpi_cpu_unplug_request_cb(hotplug_dev, &lpc->pm.cpuhp_state, dev, errp); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { + acpi_pcihp_device_unplug_request_cb(hotplug_dev, + &lpc->pm.acpi_pci_hotplug, + dev, errp); } else { error_setg(errp, "acpi: device unplug request for not supported device" " type: %s", object_get_typename(OBJECT(dev))); @@ -469,6 +533,9 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) && !lpc->pm.cpu_hotplug_legacy) { acpi_cpu_unplug_cb(&lpc->pm.cpuhp_state, dev, errp); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { + acpi_pcihp_device_unplug_cb(hotplug_dev, &lpc->pm.acpi_pci_hotplug, + dev, errp); } else { error_setg(errp, "acpi: device unplug for not supported device" " type: %s", object_get_typename(OBJECT(dev))); diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index bb457bc279..8ab65502ce 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -30,6 +30,8 @@ #include "hw/pci-host/i440fx.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h" +#include "hw/pci/pci_host.h" +#include "hw/i386/acpi-build.h" #include "hw/acpi/acpi.h" #include "exec/address-spaces.h" #include "hw/pci/pci_bus.h" @@ -88,6 +90,7 @@ static void *acpi_set_bsel(PCIBus *bus, void *opaque) static void acpi_set_pci_info(void) { static bool bsel_is_set; + Object *host = acpi_get_i386_pci_host(); PCIBus *bus; unsigned bsel_alloc = ACPI_PCIHP_BSEL_DEFAULT; @@ -96,7 +99,7 @@ static void acpi_set_pci_info(void) } bsel_is_set = true; - bus = find_i440fx(); /* TODO: Q35 support */ + bus = PCI_HOST_BRIDGE(host)->bus; if (bus) { /* Scan all PCI buses. Set property to enable acpi based hotplug. */ pci_for_each_bus_depth_first(bus, acpi_set_bsel, NULL, &bsel_alloc); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b7811a8912..8787b6fb33 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -270,7 +270,7 @@ static void acpi_get_misc_info(AcpiMiscInfo *info) * Because of the PXB hosts we cannot simply query TYPE_PCI_HOST_BRIDGE. * On i386 arch we only have two pci hosts, so we can look only for them. */ -static Object *acpi_get_i386_pci_host(void) +Object *acpi_get_i386_pci_host(void) { PCIHostState *host; From patchwork Thu Sep 24 07:00:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 304582 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 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 1900EC4346E for ; Thu, 24 Sep 2020 07:02:45 +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 994342388A for ; Thu, 24 Sep 2020 07:02:44 +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="S3LIt5HX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 994342388A 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]:48508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLH9-0002EO-KN for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:02:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFS-0000xM-1w for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25359) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLFQ-0005Je-8v for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930855; 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=ymlR3AzWDukUaAx+Ufl+5dNMAPyM0Z+N8lzBqbv7xvE=; b=S3LIt5HXxCcY1X+dYdh5ZYs7Lx/6aZCnWVmraPwdiUVW1t5cEAc5UoCVADaDc4RNu2sGq3 z9XP5c5bX/GbM6ccKbtErzIyjWyDUB8dsFveTyCRLcRiT817gKp66JARArRYYx968NgQsv 0yyfQNjrcCD6WnUSDadqpKDLqDoJOMY= 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-185-vIO8BAEIOvmTxKtI3qx0iQ-1; Thu, 24 Sep 2020 03:00:51 -0400 X-MC-Unique: vIO8BAEIOvmTxKtI3qx0iQ-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 12091800462; Thu, 24 Sep 2020 07:00:50 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 535D273668; Thu, 24 Sep 2020 07:00:48 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 5/7] bios-tables-test: Allow changes in DSDT ACPI tables Date: Thu, 24 Sep 2020 09:00:11 +0200 Message-Id: <20200924070013.165026-6-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 23:02:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" All DSDT Q35 tables will be modified because ACPI hot-plug is enabled by default. Signed-off-by: Julia Suvorova Acked-by: Ani Sinha --- tests/qtest/bios-tables-test-allowed-diff.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..84f56b14db 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,11 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.tis", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.dimmpxm", From patchwork Thu Sep 24 07:00:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 272902 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 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 231D5C4346E for ; Thu, 24 Sep 2020 07:06:48 +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 5CA692388A for ; Thu, 24 Sep 2020 07:06:47 +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="N5KI4xSD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CA692388A 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]:59588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLL4-0006sH-CU for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:06:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFS-0000xY-9h for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLFQ-0005Jh-HI for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:00:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930855; 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=E4HfwY0bkFQVLDlWgoz8rpqz2t6xSvRYuOYgLeL6gok=; b=N5KI4xSDsZrpl46bRGXEjqlhES3RB5xDwrmUVb9hQ+xjG04YQLab0FG/au7/B1Niv8BOS4 xlFnhb0f08ergUBlJu52KtSjvYRPLK8rFcv9g/jbzBezpTHETxRcrdStVgt5hdMJgzPgYD d9JqyPJneLgbUcgfXNGMuezJXw5deF4= 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-394-MtHIpekwN0i2VdLVndycMg-1; Thu, 24 Sep 2020 03:00:53 -0400 X-MC-Unique: MtHIpekwN0i2VdLVndycMg-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 C2A8E8030A6; Thu, 24 Sep 2020 07:00:52 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FBA773662; Thu, 24 Sep 2020 07:00:50 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 6/7] hw/acpi/ich9: Set ACPI PCI hot-plug as default Date: Thu, 24 Sep 2020 09:00:12 +0200 Message-Id: <20200924070013.165026-7-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/24 01:10:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Julia Suvorova --- hw/acpi/ich9.c | 2 +- hw/i386/pc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 987f23e388..c67c20de4e 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -425,7 +425,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) pm->disable_s3 = 0; pm->disable_s4 = 0; pm->s4_val = 2; - pm->use_acpi_hotplug_bridge = false; + pm->use_acpi_hotplug_bridge = true; object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, &pm->pm_io_base, OBJ_PROP_FLAG_READ); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b55369357e..5de4475570 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -101,6 +101,7 @@ GlobalProperty pc_compat_5_1[] = {}; const size_t pc_compat_5_1_len = G_N_ELEMENTS(pc_compat_5_1); GlobalProperty pc_compat_5_0[] = { + { "ICH9-LPC", "acpi-pci-hotplug-with-bridge-support", "off" }, }; const size_t pc_compat_5_0_len = G_N_ELEMENTS(pc_compat_5_0); From patchwork Thu Sep 24 07:00:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Suvorova X-Patchwork-Id: 304579 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 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 1F13EC4346E for ; Thu, 24 Sep 2020 07:07:40 +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 4E386235F7 for ; Thu, 24 Sep 2020 07:07:39 +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="Zse2KV81" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E386235F7 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]:34068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLLu-0007zT-B5 for qemu-devel@archiver.kernel.org; Thu, 24 Sep 2020 03:07:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLLFZ-00010J-5B for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:01:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kLLFW-0005KK-Jn for qemu-devel@nongnu.org; Thu, 24 Sep 2020 03:01:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600930860; 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=pdqhR8jPoPpkc4zaJxiwGvpN0edVpcLRY9C9ZvE0TjQ=; b=Zse2KV81bbG+JJo+lohHTScBfBN2dc6ewSUNzLaeDwupWs1MPB+B3gP+Nxaz2l42HCQ3Hz 7csRB6AjlUdU5+NCuYcVlG2fmwIOGFPReE6sclPRaMeAZ3EMhCmKpHBRydXh5FPN2yw3aS egkgpJVNvcDagbX8+AHsfQoz/l6Vh6I= 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-154-2fNT0GN3OAujE9YUgPfNTw-1; Thu, 24 Sep 2020 03:00:56 -0400 X-MC-Unique: 2fNT0GN3OAujE9YUgPfNTw-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 BB9BC10082EA; Thu, 24 Sep 2020 07:00:55 +0000 (UTC) Received: from pc-72.home.com (unknown [10.40.194.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C884D73662; Thu, 24 Sep 2020 07:00:53 +0000 (UTC) From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 7/7] bios-tables-test: Update golden binaries Date: Thu, 24 Sep 2020 09:00:13 +0200 Message-Id: <20200924070013.165026-8-jusual@redhat.com> In-Reply-To: <20200924070013.165026-1-jusual@redhat.com> References: <20200924070013.165026-1-jusual@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=jusual@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=jusual@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/24 01:10:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.228, 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: Ani Sinha , Igor Mammedov , Julia Suvorova , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add ACPI hot-plug registers to DSDT Q35 tables. Changes in the tables: + Scope (_SB.PCI0) + { + OperationRegion (PCST, SystemIO, 0x0CC4, 0x08) + Field (PCST, DWordAcc, NoLock, WriteAsZeros) + { + PCIU, 32, + PCID, 32 + } + + OperationRegion (SEJ, SystemIO, 0x0CCC, 0x04) + Field (SEJ, DWordAcc, NoLock, WriteAsZeros) + { + B0EJ, 32 + } + + OperationRegion (BNMR, SystemIO, 0x0CD4, 0x04) + Field (BNMR, DWordAcc, NoLock, WriteAsZeros) + { + BNUM, 32 + } + + Mutex (BLCK, 0x00) + Method (PCEJ, 2, NotSerialized) + { + Acquire (BLCK, 0xFFFF) + BNUM = Arg0 + B0EJ = (One << Arg1) + Release (BLCK) + Return (Zero) + } + } + ... Scope (_GPE) { Name (_HID, "ACPI0006" /* GPE Block Device */) // _HID: Hardware ID + Method (_E01, 0, NotSerialized) // _Exx: Edge-Triggered GPE, xx=0x00-0xFF + { + Acquire (\_SB.PCI0.BLCK, 0xFFFF) + \_SB.PCI0.PCNT () + Release (\_SB.PCI0.BLCK) + } } ... + + Device (PHPR) + { + Name (_HID, "PNP0A06" /* Generic Container Device */) // _HID: Hardware ID + Name (_UID, "PCI Hotplug resources") // _UID: Unique ID + Name (_STA, 0x0B) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0CC4, // Range Minimum + 0x0CC4, // Range Maximum + 0x01, // Alignment + 0x14, // Length + ) + }) + } } And if there is a port in configuration: Device (S10) { Name (_ADR, 0x00020000) // _ADR: Address + Name (BSEL, Zero) + Device (S00) + { + Name (_SUN, Zero) // _SUN: Slot User Number + Name (_ADR, Zero) // _ADR: Address + Method (_EJ0, 1, NotSerialized) // _EJx: Eject Device, x=0-9 + { + PCEJ (BSEL, _SUN) + } + } + ... + + Method (DVNT, 2, NotSerialized) + { + If ((Arg0 & One)) + { + Notify (S00, Arg1) + } + + If ((Arg0 & 0x02)) + { + Notify (S08, Arg1) + } + ... Signed-off-by: Julia Suvorova --- tests/qtest/bios-tables-test-allowed-diff.h | 10 ---------- tests/data/acpi/q35/DSDT | Bin 7678 -> 7950 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9002 -> 9274 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7695 -> 9865 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8141 -> 8413 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9331 -> 9603 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7753 -> 8025 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9037 -> 9309 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8808 -> 9080 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7684 -> 7956 bytes tests/data/acpi/q35/DSDT.tis | Bin 8283 -> 8555 bytes 11 files changed, 10 deletions(-) diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT index bba8884073a27427b88ac0d733c9c87330a59366..56e5b111f3239ea0af2cfb6dea962e3cd837da80 100644 GIT binary patch delta 329 zcmexo-Dk(;66_MfC(ppZ*twDGAXB}72ZvsKuv2`1v!_9HLx6K|2qX6q9xjgPMgb7V z87LmA03=)#q8ox;z2X_U&+u@uL^pDSIL=N6u3kV1CqLgHM(!&R2@uEG$uHDbA)3+2 z$Jv`fL^Z(K)r%=w8N~blzaRr7Sy0KC$>3zb>FO1&4iaCo`4m&6WRO2gynBEvN4$rp z3$LSdfTw|hff<8{WxT6_Aw#rsj6O5Wtq`-21OlA>LZa1?1VAbTd_^}~$?!9JMK^h| z1b74lK}-(t3ovj58q5(N3bY64I|YyYl7gJlbcLeS;{4L0R delta 57 zcmeCP`)AGN66_N4PnLm!am_}qgG`%4m?I>`MdIB9Tsh)BJY9GlodY}#3=GT|1RMo7 N|C8ZooE#~)6#(|i5Rd=> diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat index 9cac92418b5fcc2767dc74603d599642b59623fe..aff5e7d14fdb5b1a332dcc1866d33bff5247a996 100644 GIT binary patch delta 305 zcmZ4Gw#$RdCDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVF^C_lQxgdX*c=rHTj(87G z7hXr_08ax012YB@%Xn75~JLWZ91J9N}RUnOv;29RTA-R3QKW delta 57 zcmdnxvC56hCD4 NwUqc7C$}nZ1pvgG4-fzV diff --git a/tests/data/acpi/q35/DSDT.bridge b/tests/data/acpi/q35/DSDT.bridge index f08b7245f59aad491fcaa60e2bab1085c369ea1c..355c4462bb414efb83f530aa1eb9073dda899379 100644 GIT binary patch delta 2280 zcmZ{mO-~a+7{_O~MV4tx7g*jYG(kl#xTrueCenQoTIsUswj^eWdoaY3n9zWjn38Pa zK*GrbUx0&Oz;N?s!pV5_`{46*_bELvm!|*u|N5KR?(DSRUtd(XY3Ozt3d5;X zrPRNuz+f6qy^{AOW6ONUv`4OKmt}t*)9r1ufo1cXw9gEEz%Kg>IR4}MkNkeJx}6L* zTw4h?OID_6x+PuLSD3aI*!mLl=XakaXswZ}XTUX`n!nI9fP`8Zy?!;5mCF8EIq7b? z)yV8Ru3iMO64YTHxVrr2!I$Re<4^g+y`zKU!;gDM(0R2YPbq;}^@cK>Z%8-ko3x}| zZshiP>0}odq83jsf92kU+h4sUJy3$8RZTM{GsW=iE#{v+^mH8d>JI3jWZH0Gmvsrh z4@9u>&z^XCA)+KwNcWRZqiNt%TqaazT6muo*x1Sw#3n@A=kYRmlF+0OC2Jp{eW8eb zLD~nzJ`kd$?I*NfguW!J5~Cqgge++XNIM`xmr2VBJ zC}}fy}4nv=73LZ>EQrCJS% zo#TPKf0b@ExQw9?ha?0zp`%8@K#d9kPQR$hW1wao0vupb)5d^JrqxI>oCr>#ILRT# zZi#cjSrV5x*>bnT+2BBkJDhH%+u?lhSjQbsxQbo2)qvwgVvynKq%3!G+~fI^!~uBD z2v9otPM~6jCx-fbC*Sq!m|^Qv-|pnQzH`m6hpC5OxpU8q`VdzLD>(OHJ9YuQa;ryx z*ADxt+vhR&^y`pegLL~gX6Us!{Ap)RhJPEZ9jAtWNu>CV#S@yE?EoJZ@fPFT|1AtG AF#rGn delta 95 zcmeD5?YH4_33dtLmt$aH^xnvIkZE%WbA+V0NW6Q1D@VMCrwgy6bAYFTfq@x=fTQ5% ze=_`xlOyHQx%^pU;)9*y1>9LDpOUi|;}148i06oRbP3{NU|?bpVGD5f3t<2NdEgd> diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp index 57d859cef9fa16a8f125c4b338611c8472699f38..4d66dc1c564e6b3ff2a5cc1cf9c8447a095ab9a4 100644 GIT binary patch delta 329 zcmX?Wf7g-ACDj@AI!JuU=2J`>(n0<#@$Lbx9Pu8W zF1(J;0iFg124)N*mhr9zh78flG5X9fw?fQ95(sei3yD@o5&)?X@D<(6DaX&~72V{; z65tUK1Ti_lFTlVNXfQ{7D9|3D?-V@pOA2yI(-n$Ri}Op1l2eO;a={^vT-+S-&OyO~ Uyj)!Fj7NBm@Gy!@7L(r&0AY4nrvLx| delta 57 zcmccXc-EfFCDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVF^C_lX@@dX&@$Lbx9Pu8W zF1(J;0iFg124)N*mhr9zh78flG5X9fw?fQ95(sei3yD@o5&)?X5eDisVQ7m1`_V7V zC5Wp*z*lthdL@2Fj_4*YmH>}{pvjHOBHTbPDtP3V6y%hqPoAkP%XWn42oIyknjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVFvnX?LZa1?1VAbTd__06%J4JFM>lz~ t1b74lK}-(t3ovj58q5(N3bY64yUBu*!jr3Hh1ibp9N}RUnLJ5$I{*hoQAGd% delta 57 zcmcacGrW;CDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVF^C_kkazXwq@$Lbx9Pu8W zF1(J;0iFg124)N*mhr9zh78flG5X9fw?fQ95(sei3yD@o5&)?X@D<(MsmRah72V{; z65tUK1Ti_lFTlVNXfQ{7D9|3D?-V@pOA2yI(-n$Ri}Op1l2eO;a={^vT-+S-&OyO~ Uyj)!Fj7NBm@Gy!@o~E=N0Pb*GIsgCw delta 57 zcmccXan_B?CDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVF^C_lHvO)eV@$Lbx9Pu8W zF1(J;0iFg124)N*mhr9zh78flG5X9fw?fQ95(sei3yD@o5&)?X@D<%WS%IHXJ-W$@ xCBP#f2x4-8Ux0xl&|r@EP@p|P-zj+HmlWibrcbU_lw~`@bA*RcWby*V69BpsRd)aY delta 57 zcmez2_QHkBCD)i3zb>FO1&4iaCo`4m&UWRO2gynBEvN4$rp z3$LSdfTw|hff<8{WxT6_Aw#rsj6O5Wtq`-21OlA>LZa1?1VAbTd_^}q$nZ0&M>lz~ x1b74lK}-(t3ovj58q5(N3bY64I|YyYl7gJl^vPPXvTR3qj_@#wO!k%C4gm3?QpNxP delta 57 zcmbPY*J8uv66_MfBFDhM7`l<`Ak*d$<~T`lk$Cq2SB`iOPZwTC=KxOw0|PS#0Y|~j NEVBHJljG&K0sxuq4d4I( diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis index 638de3872673d17b1958497d0e62c83653de1602..dd712090ee9c09ed98f3b658951ac8a62b31a7d4 100644 GIT binary patch delta 306 zcmccZ@Y;#XCDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=)72|l9VEVF^C_lC$sm80c=rHTj(87G z7hXr_08ax012YB@%Xn75~m)W!aAK9N}RU*&Hm(!3+S%CsU9B delta 58 zcmaFublZW;CD