From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931014; cv=none; d=zohomail.com; s=zohoarc; b=SkwjaRD5Hvy0sd6N2szQcRmKrgtQUa8/j9XcP4hdrFLAZ2sTRGUAMHB/oBW3HIiYAN8KKv+I59LyyhhkqFdP1dKDDe2oeGIOFpaqh5OjSn+aey7qDgyey6TfXqDOxVraUS24XjFZhpipcPV7oYfRbTF1IgSBWJ8gxZ8UdwnpReU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931014; 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=JQLMvXv0mUTil+NTyNbK8XITxK8lzlUehkO/ZxdRbFw=; b=H1z1ZVIvdtRHasfnh/qr47+RMTBa/DJjbLQMNEJxXs2ecmPS8Ta/ovNl1C6AO/XlL88Ix/TFx4FfPfjnzffkNLITCtE0OgFiWkuHoEMi3D0mGefs/2Tt3j6ujSju4QvSNCFFhY5yviEBwIz40x6M2AQcwtsO+rP+xNiI5yFBTOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931014806971.0874947112777; Thu, 24 Sep 2020 00:03:34 -0700 (PDT) Received: from localhost ([::1]:50780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLHx-0003BW-Ew for importer@patchew.org; Thu, 24 Sep 2020 03:03:33 -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 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 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) 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= X-MC-Unique: F3VBvfzJN9yoivFLgfIQag-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 =3D acpi_get_i386_pci_host(); PCIBus *bus; =20 if (root_hp_disabled) { return; } =20 - bus =3D find_i440fx(); + bus =3D PCI_HOST_BRIDGE(host)->bus; if (bus) { /* setting the hotplug handler to NULL makes the bus non-hotplugga= ble */ qbus_set_hotplug_handler(BUS(bus), NULL); --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931100; cv=none; d=zohomail.com; s=zohoarc; b=FphbzSP6mk2wEfSI585BgDtQEE9mGROPWDJbBXkQBFYUumeK6Za8yH+xCxjWRaU4j08OmuCxwtuDsvSWdcPzue4WCgO0y7eUBAhDLv53TmX9IEEGlRMFHlL0AADdYa3tN4UmYaSKmfd91apt5bWN8zh9hJgVBu0Nd9NlpIKVfwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931100; 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=ZQFwmbZ4VN7pHz4afY3coYkBHA9Q3kTDJur7/45jT3U=; b=dsfQN7fB3kchCmLtnrmgIh0HPQFBSb4QcyHcSJgLoN+LSSpvWBDQrjYfv8NUDV9yO8zzBSKeCc11t+t5Hy9745P2SwkikyI13b+B/QJxM+VRAy5+JwlvuRoFqbw+Qz+SPrrmcS74tzMdu5JjJJez7T4umM+Y7qKPjVDSKOgM6go= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931100819659.8703305894567; Thu, 24 Sep 2020 00:05:00 -0700 (PDT) Received: from localhost ([::1]:54364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLJK-0004dy-Du for importer@patchew.org; Thu, 24 Sep 2020 03:04:58 -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 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 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) 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= X-MC-Unique: 3TQS8U39O5m6Xhy5BsBOFQ-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Acked-by: Gerd Hoffmann --- 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 @@ =20 extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio; =20 +/* 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); =20 #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" =20 +#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; =20 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); =20 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" =20 -#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 =3D { }; =20 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 =3D ACPI_PCIHP_SIZE; - s->io_base =3D ACPI_PCIHP_ADDR; + s->io_base =3D io_base; =20 - s->root=3D root_bus; + s->root =3D root_bus; s->legacy_piix =3D !bridges_enabled; =20 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 =20 +#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); =20 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); =20 s->cpu_hotplug_legacy =3D 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, Ac= piPmInfo *pm) /* w2k requires FADT(rev1) or it won't boot, keep PC compatible */ pm->fadt.rev =3D 1; pm->cpu_hp_io_base =3D PIIX4_CPU_HOTPLUG_IO_BASE; - pm->pcihp_io_base =3D - object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); - pm->pcihp_io_len =3D - object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); } if (lpc) { struct AcpiGenericAddress r =3D { .space_id =3D AML_AS_SYSTEM_IO, @@ -214,6 +210,10 @@ static void acpi_get_pm_info(MachineState *machine, Ac= piPmInfo *pm) pm->fadt.flags |=3D 1 << ACPI_FADT_F_RESET_REG_SUP; pm->cpu_hp_io_base =3D ICH9_CPU_HOTPLUG_IO_BASE; } + pm->pcihp_io_base =3D + object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); + pm->pcihp_io_len =3D + object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); =20 /* 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_sc= ope, PCIBus *bus, QLIST_FOREACH(sec, &bus->child, sibling) { int32_t devfn =3D sec->parent_dev->devfn; =20 - if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) { + if (pci_bus_is_root(sec)) { continue; } =20 @@ -1368,7 +1368,7 @@ static void build_piix4_isa_bridge(Aml *table) aml_append(table, scope); } =20 -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 =3D aml_scope("_SB.PCI0"); =20 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), 0= x08)); field =3D aml_field("PCST", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZE= ROS); aml_append(field, aml_named_field("PCIU", 32)); aml_append(field, aml_named_field("PCID", 32)); aml_append(scope, field); =20 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 =3D aml_field("SEJ", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZER= OS); aml_append(field, aml_named_field("B0EJ", 32)); aml_append(scope, field); =20 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), 0= x04)); field =3D aml_field("BNMR", AML_DWORD_ACC, AML_NOLOCK, AML_WRITE_AS_ZE= ROS); 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 =3D 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"))); =20 - if (misc->is_piix4) { + if (misc->is_piix4 || pm->pcihp_bridge_en) { method =3D aml_method("_E01", 0, AML_NOTSERIALIZED); aml_append(method, aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF)); --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931196; cv=none; d=zohomail.com; s=zohoarc; b=IToM6tdZn3hzOLaekRzaH4aQhWMsEq9bphBZDlBoFVx2lPpgn3S4eZE1YHPvzcyaMQZuxbjpctJsKIiPNQfTDgPnZKM3tPvo44HIMTIAxcajANh4Ca6axwITXSbMYxtJtGjeXu9LNuMO7Z9cOWKFcESvuc1Gm54E/A1jnEQc1Fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931196; 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=IL7nzAh7Mf9HR3Z9mYJS5y5wKlSwZthpUxqWFbQmTzM=; b=KzAKJyE2bY3CVSE0IsqTlz4XB7bh1Y2dbMH7fxaQg3FqHQaT/2JUqXYGrTAaLkFTFQNz2fPGhwrcoKaL6neAwr1w6M6ZEODh2Z9b/Peb9PUMTbIHDqHjxeHKxAcgxoXw6TmDGoHgm+pcPOCITcVCTkuEeEl5ffAUreqqNzVRwtg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931196822391.82151074905585; Thu, 24 Sep 2020 00:06:36 -0700 (PDT) Received: from localhost ([::1]:58648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLKt-0006VB-Hy for importer@patchew.org; Thu, 24 Sep 2020 03:06:35 -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 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 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) 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= X-MC-Unique: 3SGnW4NzOBiEyHxyYYUmfQ-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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_ds= mio; =20 void acpi_setup(void); =20 +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, Obj= ect *o, *data =3D fadt; } =20 -static Object *object_resolve_type_unambiguous(const char *typename) +Object *object_resolve_type_unambiguous(const char *typename) { bool ambig; Object *o =3D 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" =20 //#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); } =20 +static bool acpi_pcihp_enabled(void) +{ + Object *lpc =3D object_resolve_type_unambiguous(TYPE_ICH9_LPC_DEVICE); + + return lpc && + object_property_get_bool(lpc, "acpi-pci-hotplug-with-bridge-sup= port", + 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 =3D dev->exp.exp_cap; =20 + if (acpi_pcihp_enabled()) { + return; + } + pci_word_test_and_set_mask(dev->config + pos + PCI_EXP_FLAGS, PCI_EXP_FLAGS_SLOT); =20 --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931128; cv=none; d=zohomail.com; s=zohoarc; b=Mum65Sa1vdD+94bfsUV+bI8lLVeFkB+sKF0dvAZ68s753kQuPgXdeHz+Ra5UnFx7pBXLax6MCJcxtVQodVT1KUrwwrljRjEmvjxbhoPlUKbbWzuF+UjxWTIjNqFrajIzlLE5CmwlnMQu6RtEhzDXKQoj22jCFrchvPkLAIc2ijw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931128; 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=4HsZKWB1ml7V0h856im4DRe/N7mUj7BSaI1tUFfOCkQ=; b=RyKghTmBNRDwfVBa5SeKWAWMM+v9vAotqqqAZ86SAC8ahdCZ8dAaZAv2+fqjs7zJM7QApbQFYb2Ndz1+8q9XoJkl0v3k36+6F+q4CVGfZjZYHV+X2EjxzNYZDC7AviJTInDv2cIFBcrylPIbA/+fZN2g5kmdrvQkU7SphpoMNZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931128415390.183577910602; Thu, 24 Sep 2020 00:05:28 -0700 (PDT) Received: from localhost ([::1]:55336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLJl-00053c-Un for importer@patchew.org; Thu, 24 Sep 2020 03:05:25 -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 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 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) 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= X-MC-Unique: JCz1oyE3NkK_1l1L0KYr8g-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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_ds= mio; #define ACPI_PCIHP_BNMR_BASE 0x10 =20 void acpi_setup(void); +Object *acpi_get_i386_pci_host(void); =20 Object *object_resolve_type_unambiguous(const char *typename); =20 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; =20 + bool use_acpi_hotplug_bridge; + AcpiPciHpState acpi_pci_hotplug; MemHotplugState acpi_memory_hotplug; =20 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 = =3D { } }; =20 +static bool vmstate_test_use_pcihp(void *opaque) +{ + ICH9LPCPMRegs *s =3D opaque; + + return s->use_acpi_hotplug_bridge; +} + +static const VMStateDescription vmstate_pcihp_state =3D { + .name =3D "ich9_pm/pcihp", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D vmstate_test_use_pcihp, + .fields =3D (VMStateField[]) { + VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, + ICH9LPCPMRegs, + NULL), + VMSTATE_END_OF_LIST() + } +}; + const VMStateDescription vmstate_ich9_pm =3D { .name =3D "ich9_pm", .version_id =3D 1, @@ -239,6 +259,7 @@ const VMStateDescription vmstate_ich9_pm =3D { &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 =3D ~0; =20 + acpi_pcihp_reset(&pm->acpi_pci_hotplug, true); acpi_update_sci(&pm->acpi_regs, pm->irq); } =20 @@ -298,6 +320,18 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *p= m, pm->enable_tco =3D true; acpi_pm_tco_init(&pm->tco_regs, &pm->io); =20 + 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 =3D sci_irq; qemu_register_reset(pm_reset, pm); pm->powerdown_notifier.notify =3D pm_powerdown_req; @@ -369,6 +403,20 @@ static void ich9_pm_set_enable_tco(Object *obj, bool v= alue, Error **errp) s->pm.enable_tco =3D value; } =20 +static bool ich9_pm_get_acpi_pci_hotplug(Object *obj, Error **errp) +{ + ICH9LPCState *s =3D 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 =3D ICH9_LPC_DEVICE(obj); + + s->pm.use_acpi_hotplug_bridge =3D value; +} void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) { static const uint32_t gpe0_len =3D ICH9_PMIO_GPE0_LEN; @@ -377,6 +425,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) pm->disable_s3 =3D 0; pm->disable_s4 =3D 0; pm->s4_val =3D 2; + pm->use_acpi_hotplug_bridge =3D false; =20 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); } =20 void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *= dev, @@ -407,6 +459,11 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplu= g_dev, DeviceState *dev, { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); =20 + 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 devi= ce" " 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 de= vice" " type: %s", object_get_typename(OBJECT(dev))); @@ -469,6 +533,9 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_d= ev, 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 =3D acpi_get_i386_pci_host(); PCIBus *bus; unsigned bsel_alloc =3D ACPI_PCIHP_BSEL_DEFAULT; =20 @@ -96,7 +99,7 @@ static void acpi_set_pci_info(void) } bsel_is_set =3D true; =20 - bus =3D find_i440fx(); /* TODO: Q35 support */ + bus =3D 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; =20 --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600930968; cv=none; d=zohomail.com; s=zohoarc; b=HJd9KY9VSnjkIhKplO8sFG5T34q6ez/LFEp/Vj3e1zSHm7IovWmvNTsfdHN8TwFAuF3LGyroB2NKOrO1wJ+FX4FI/zVR1dOpz8CVS41Y4mDfVtNU7JfV4R1h9kNEx+LxFlmCH/cvsSYc90K79s/rBk9gxLwjv2k7CmuIqXPElfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600930968; 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=ymlR3AzWDukUaAx+Ufl+5dNMAPyM0Z+N8lzBqbv7xvE=; b=ewDi+Ars6kevSQLo/2fqcyW+f6kp9l7/U7UgqmP5s2LDXauxAYnA4ZocRpK+8YOE8LvCeVBqw83G2JaMthoVWeBfkCt2FasM1CaAbhvac1lmBbS/FMfNuXOoN9lPjwjfreoBcAx52PUkSQjxXZ2+hOx7C6/gzrqMo8rcOJv6p0Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600930968772859.5793253465681; Thu, 24 Sep 2020 00:02:48 -0700 (PDT) Received: from localhost ([::1]:48508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLHD-0002EO-HT for importer@patchew.org; Thu, 24 Sep 2020 03:02:47 -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 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 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) 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= X-MC-Unique: vIO8BAEIOvmTxKtI3qx0iQ-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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", --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931210; cv=none; d=zohomail.com; s=zohoarc; b=jjYj4FqoFiiV8NyN+OYvdITbMlDhzS94EHVLV0f85ywed2g3IJxqdoCEjciWS/WTBtJyp/fQPzqPptwaSdP1xyFNf4Qw/7TqvMGGaYdlViHYht7BH/PlJZ740AtrX7U87tsoXZuykJOgt5jd8s9oTfTAWzkUwhrmK+yX+v1nAbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931210; 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=E4HfwY0bkFQVLDlWgoz8rpqz2t6xSvRYuOYgLeL6gok=; b=Kb+23jb8SMY+Colq1FdZSn8JniwQuEyo4dag4WayShqc+vWILMVDvmo4PQ7+V9rHCbv+y4uHzQlJrM+HjWxq4bbnYPvVXEE53XJxDM8rIi+4m5kPJyWInBwNZLbNoHGVV/L4jXzX5WwE5d/5DfPwtka85ZDnbKLNp2GcJsbQeaE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931210656154.40596851864734; Thu, 24 Sep 2020 00:06:50 -0700 (PDT) Received: from localhost ([::1]:59588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLL7-0006sH-6q for importer@patchew.org; Thu, 24 Sep 2020 03:06:49 -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 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 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) 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= X-MC-Unique: MtHIpekwN0i2VdLVndycMg-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 =3D 0; pm->disable_s4 =3D 0; pm->s4_val =3D 2; - pm->use_acpi_hotplug_bridge =3D false; + pm->use_acpi_hotplug_bridge =3D true; =20 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[] =3D {}; const size_t pc_compat_5_1_len =3D G_N_ELEMENTS(pc_compat_5_1); =20 GlobalProperty pc_compat_5_0[] =3D { + { "ICH9-LPC", "acpi-pci-hotplug-with-bridge-support", "off" }, }; const size_t pc_compat_5_0_len =3D G_N_ELEMENTS(pc_compat_5_0); =20 --=20 2.25.4 From nobody Thu May 16 02:00:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600931269; cv=none; d=zohomail.com; s=zohoarc; b=KsQ50AvmG7i0KhKlo0wnjV6q7/c50DaeBatoM1WhWNQtdPlic7fQs97Wl2tBx3o6QvCFiLnB8wybtPEsioiIkx4fzL/q4TFdVAsRkSvc+5JEJYlIRGJSJVrrXvqPIB45W0d2mccIhaBr01dSmUYuSMS0UCXxGnWcB5bfwibfiBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600931269; 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=pdqhR8jPoPpkc4zaJxiwGvpN0edVpcLRY9C9ZvE0TjQ=; b=VAAjxY/mI9hrras96lo71OqUNAfiCEFBgQ/VQXV6I6PS0ZLwwExuAqKLKf9NuB4KomQ88CN3fDlvat4l0+ttyRkz5uqnNhZ2frfVr2l78jrpbT2EmMFw6EIiPtnGB280aWmxJkjpxsvO7+1EzTEcLCLYZq0yeP2TK5lmZ+/1PrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600931269661127.93336968066615; Thu, 24 Sep 2020 00:07:49 -0700 (PDT) Received: from localhost ([::1]:34068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLLM4-0007zT-2W for importer@patchew.org; Thu, 24 Sep 2020 03:07:48 -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 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 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) 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= X-MC-Unique: 2fNT0GN3OAujE9YUgPfNTw-1 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 Content-Transfer-Encoding: quoted-printable 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@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 =3D Arg0 + B0EJ =3D (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= =3D0x00-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 Set= tings + { + 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=3D0-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/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios= -tables-test-allowed-diff.h index 84f56b14db..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,11 +1 @@ /* 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", diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT index bba8884073a27427b88ac0d733c9c87330a59366..56e5b111f3239ea0af2cfb6dea9= 62e3cd837da80 100644 GIT binary patch delta 329 zcmexo-Dk(;66_MfC(ppZ*twDGAXB}72ZvsKuv2`1v!_9HLx6K|2qX6q9xjgPMgb7V z87LmA03=3D)#q8ox;z2X_U&+u@uL^pDSIL=3DN6u3kV1CqLgHM(!&R2@uEG$uHDbA)3+2 z$Jv`fL^Z(K)r%=3Dw8N~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=3DGT|1RMo7 N|C8ZooE#~)6#(|i5Rd=3D> diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.a= cpihmat index 9cac92418b5fcc2767dc74603d599642b59623fe..aff5e7d14fdb5b1a332dcc1866d= 33bff5247a996 100644 GIT binary patch delta 305 zcmZ4Gw#$RdCDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=3D)72|l9VEVF^C_lQxgdX*c=3DrHTj(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.bri= dge index f08b7245f59aad491fcaa60e2bab1085c369ea1c..355c4462bb414efb83f530aa1eb= 9073dda899379 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=3DXakaXswZ}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=3DiE#{v+^mH8d>JI3jWZH0Gmvsrh z4@9u>&z^XCA)+KwNcWRZqiNt%TqaazT6muo*x1Sw#3n@A=3DkYRmlF+0OC2Jp{eW8eb zLD~nzJ`kd$?I*NfguW!J5~Cqgge++XNIM`xmr2VBJ zC}}fy}4nv=3D73LZ>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=3DfTQ5% ze=3D_`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..4d66dc1c564e6b3ff2a5cc1cf9c= 8447a095ab9a4 100644 GIT binary patch delta 329 zcmX?Wf7g-ACDj@AI!JuU=3D2J`>(n0<#@$Lbx9Pu8W zF1(J;0iFg124)N*mhr9zh78flG5X9fw?fQ95(sei3yD@o5&)?X@D<(6DaX&~72V{; z65tUK1Ti_lFTlVNXfQ{7D9|3D?-V@pOA2yI(-n$Ri}Op1l2eO;a=3D{^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=3D)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=3D)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=3D)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=3D{^vT-+S-&OyO~ Uyj)!Fj7NBm@Gy!@o~E=3DN0Pb*GIsgCw delta 57 zcmccXan_B?CDnjRGK! zGf+HK0Z6zgL^lMxdc`wxpW)$RiEiWuah#nDT)lu2PJX^YjNDfs5+IJVlV7N>LNue3 zkFz&}h-!eds~1zWGKly8e?bOFvY?VNlflV=3D)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=3DKxOw0|PS#0Y|~j NEVBHJljG&K0sxuq4d4I( diff --git a/tests/data/acpi/q35/DSDT.tis b/tests/data/acpi/q35/DSDT.tis index 638de3872673d17b1958497d0e62c83653de1602..dd712090ee9c09ed98f3b658951= ac8a62b31a7d4 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=3D)72|l9VEVF^C_lC$sm80c=3DrHTj(87G z7hXr_08ax012YB@%Xn75~m)W!aAK9N}RU*&Hm(!3+S%CsU9B delta 58 zcmaFublZW;CD