From nobody Sun Apr 28 02:18:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=1564479528; cv=none; d=zoho.com; s=zohoarc; b=EM3YExB7R3d009uHpnAMaVCGpxKASC1t2+8gqe/igFhLJdQW90j4bam8R9L4uVK2ji4+E2c1j03Q+MZJuQpD6ltsgezmyi8zkTq0cbs706i3vqDUbdTWgX1OTotD4s5hvwj0utMNGLO4lWDofYt5anNiTzb48ae91zSRKhcYcdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564479528; h=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:ARC-Authentication-Results; bh=NHEVii0lZ3ZYiKo7cCepeU+eWNxU3Gmj7Lj3WylVuCk=; b=Fdjy5gi+StJ3SQJJ7JyUaxggoZ6pXqjEcThOTh9sw69auQMn8eyGSOGIa6pgND+jmfNEQ78naUusgu5xF9JWvnCYLCAs5cGKWPsYddWKorlmRD9CPAYo6zgGm5nmXVI4Xzje3NF04SWwgz9m086oabMKqsfecqhy3rwupQOZ4d0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564479528471914.5221506418014; Tue, 30 Jul 2019 02:38:48 -0700 (PDT) Received: from localhost ([::1]:59202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsOal-00050q-J8 for importer@patchew.org; Tue, 30 Jul 2019 05:38:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34689) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsOZU-0002Wr-VK for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsOZU-0005nH-1D for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsOZT-0005mm-Ps for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2869F636C for ; Tue, 30 Jul 2019 09:37:27 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-45.ams2.redhat.com [10.36.117.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2207919C65; Tue, 30 Jul 2019 09:37:25 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, mst@redhat.com, ehabkost@redhat.com Date: Tue, 30 Jul 2019 10:37:18 +0100 Message-Id: <20190730093719.12958-2-dgilbert@redhat.com> In-Reply-To: <20190730093719.12958-1-dgilbert@redhat.com> References: <20190730093719.12958-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 30 Jul 2019 09:37:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] pcie_root_port: Allow ACS to be disabled 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: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" ACS was added in 4.0 unconditionally, this breaks migration compatibility. Allow ACS to be disabled by adding a property that's checked by pcie_root_port. Unfortunately pcie-root-port doesn't have any instance data, so there's no where for that flag to live, so stuff it into PCIESlot. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Igor Mammedov Reviewed-by: Juan Quintela --- hw/pci-bridge/pcie_root_port.c | 3 ++- include/hw/pci/pcie_port.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 09019ca05d..1d8a778709 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -111,7 +111,7 @@ static void rp_realize(PCIDevice *d, Error **errp) pcie_aer_root_init(d); rp_aer_vector_update(d); =20 - if (rpc->acs_offset) { + if (rpc->acs_offset && !s->disable_acs) { pcie_acs_init(d, rpc->acs_offset); } return; @@ -145,6 +145,7 @@ static void rp_exit(PCIDevice *d) static Property rp_props[] =3D { DEFINE_PROP_BIT(COMPAT_PROP_PCP, PCIDevice, cap_present, QEMU_PCIE_SLTCAP_PCP_BITNR, true), + DEFINE_PROP_BOOL("disable-acs", PCIESlot, disable_acs, false), DEFINE_PROP_END_OF_LIST() }; =20 diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h index 09586f4641..7515430087 100644 --- a/include/hw/pci/pcie_port.h +++ b/include/hw/pci/pcie_port.h @@ -53,6 +53,8 @@ struct PCIESlot { PCIExpLinkSpeed speed; PCIExpLinkWidth width; =20 + /* Disable ACS (really for a pcie_root_port) */ + bool disable_acs; QLIST_ENTRY(PCIESlot) next; }; =20 --=20 2.21.0 From nobody Sun Apr 28 02:18:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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=1564479500; cv=none; d=zoho.com; s=zohoarc; b=VdBZG+g7iWU+GFOjcKyZ887bXEwK+FY4z9jIWVT/kJM2sk0UNUm8ZRgwc8HMvTrixi9s+lbnrRZ2ffj+jrwbahUH8PUKqdG8Zbg/l6Ld32bTy4i+bqHuIE4Kx6qMFS/lMAA8G7LnQV+2rCZwUc8uff2MgAzW5QngKXRYOaT5UPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564479500; h=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:ARC-Authentication-Results; bh=kyQ2rt48TnAQzX73QJCVJHYVUFSqHEXDdtbCUZCbrGU=; b=lbqZxkctNd2nw5VbVUi04i3OQvKwZFEOOc6ZGqKtg5OWdTh4K9wYcF5XQMf+9dUxsw8Tc6yUSJaG9hGIiJs2OzEUYJCNWFWg7dqBKPV7jYt7V7yZ9COBbZEhDVQtPJLzw8fgyvHPnJWUZQiVpXkiWNByhDfJpmWQ6NB0oSlESKc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 1564479500260396.1878468029871; Tue, 30 Jul 2019 02:38:20 -0700 (PDT) Received: from localhost ([::1]:59194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsOaJ-0003w4-Bl for importer@patchew.org; Tue, 30 Jul 2019 05:38:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34710) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsOZW-0002Z5-9v for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsOZV-0005oD-C1 for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsOZV-0005nj-4f for qemu-devel@nongnu.org; Tue, 30 Jul 2019 05:37:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 766B9B2DD1 for ; Tue, 30 Jul 2019 09:37:28 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-117-45.ams2.redhat.com [10.36.117.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70B0719C65; Tue, 30 Jul 2019 09:37:27 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, mst@redhat.com, ehabkost@redhat.com Date: Tue, 30 Jul 2019 10:37:19 +0100 Message-Id: <20190730093719.12958-3-dgilbert@redhat.com> In-Reply-To: <20190730093719.12958-1-dgilbert@redhat.com> References: <20190730093719.12958-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 30 Jul 2019 09:37:28 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] pcie_root_port: Disable ACS on older machines 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: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" ACS got added in 4.0 unconditionally, that broke older<->4.0 migration where there was a PCIe root port. Fix this by turning it off for 3.1 and older machines; note this fixes compatibility for older QEMUs but breaks compatibility with 4.0 for older machine types. machine type source qemu dest qemu 3.1 3.1 4.0 broken 3.1 3.1 4.1rc2 broken 3.1 3.1 4.1+this OK ++ 3.1 4.0 4.1rc2 OK 3.1 4.0 4.1+this broken -- 4.0 4.0 4.1rc2 OK 4.0 4.0 4.1+this OK So we gain and lose; the consensus seems to be treat this as a fix for older machine types. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Igor Mammedov Reviewed-by: Juan Quintela --- hw/core/machine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index c58a8e594e..26a5f30e6d 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -52,6 +52,7 @@ GlobalProperty hw_compat_3_1[] =3D { { "virtio-blk-device", "discard", "false" }, { "virtio-blk-device", "write-zeroes", "false" }, { "virtio-balloon-device", "qemu-4-0-config-size", "false" }, + { "pcie-root-port-base", "disable-acs", "true" }, /* Added in 4.1 */ }; const size_t hw_compat_3_1_len =3D G_N_ELEMENTS(hw_compat_3_1); =20 --=20 2.21.0