From patchwork Wed Dec 22 03:13:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 76355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5A95DB7088 for ; Wed, 22 Dec 2010 14:17:56 +1100 (EST) Received: from localhost ([127.0.0.1]:50845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVF9y-0007ee-6P for incoming@patchwork.ozlabs.org; Tue, 21 Dec 2010 22:14:38 -0500 Received: from [140.186.70.92] (port=37208 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVF9E-0007O4-Kz for qemu-devel@nongnu.org; Tue, 21 Dec 2010 22:13:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVF9A-0000Lm-EI for qemu-devel@nongnu.org; Tue, 21 Dec 2010 22:13:49 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:52933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVF99-0000Le-P0 for qemu-devel@nongnu.org; Tue, 21 Dec 2010 22:13:48 -0500 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 61FCE28040; Wed, 22 Dec 2010 12:13:43 +0900 (JST) Received: (nullmailer pid 7527 invoked by uid 1000); Wed, 22 Dec 2010 03:13:43 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org Date: Wed, 22 Dec 2010 12:13:43 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Blue Swirl , yamahata@valinux.co.jp, Alex Williamson , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH] pci: disable migration of p2p bridge X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Right now pcibus_get_dev_path() isn't migration save because bus number/secondary bus number are set by guest OS. So it can't be used reliably for qemu internal id. For 0.14 release, disable p2p bridge migration at the moment. Once pcibus_get_dev_path() is fixed, this patch should be reverted. It will be addressed for 0.15 release. Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Blue Swirl Signed-off-by: Isaku Yamahata --- hw/apb_pci.c | 9 +++++++++ hw/dec_pci.c | 6 ++++++ hw/ioh3420.c | 4 ++++ hw/xio3130_downstream.c | 4 ++++ hw/xio3130_upstream.c | 4 ++++ 5 files changed, 27 insertions(+), 0 deletions(-) diff --git a/hw/apb_pci.c b/hw/apb_pci.c index 84e9af7..c456d8d 100644 --- a/hw/apb_pci.c +++ b/hw/apb_pci.c @@ -368,6 +368,11 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base, qdev_init_nofail(&pci_dev->qdev); *bus2 = pci_bridge_get_sec_bus(br); + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(&pci_dev->qdev, "pbm-bridge", &pci_dev->qdev); + + pci_dev = pci_create_multifunction(d->bus, PCI_DEVFN(1, 1), true, "pbm-bridge"); br = DO_UPCAST(PCIBridge, dev, pci_dev); @@ -376,6 +381,10 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base, qdev_init_nofail(&pci_dev->qdev); *bus3 = pci_bridge_get_sec_bus(br); + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(&pci_dev->qdev, "pbm-bridge", &pci_dev->qdev); + return d->bus; } diff --git a/hw/dec_pci.c b/hw/dec_pci.c index bf88f2a..3710984 100644 --- a/hw/dec_pci.c +++ b/hw/dec_pci.c @@ -86,6 +86,12 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) br = DO_UPCAST(PCIBridge, dev, dev); pci_bridge_map_irq(br, "DEC 21154 PCI-PCI bridge", dec_map_irq); qdev_init_nofail(&dev->qdev); + + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(&dev->qdev, "dec-21154-p2p-bridge", + &dev->qdev); + return pci_bridge_get_sec_bus(br); } diff --git a/hw/ioh3420.c b/hw/ioh3420.c index 95adf09..b1a5c96 100644 --- a/hw/ioh3420.c +++ b/hw/ioh3420.c @@ -188,6 +188,10 @@ PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction, qdev_prop_set_uint16(qdev, "slot", slot); qdev_init_nofail(qdev); + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(qdev, "ioh3420", qdev); + return DO_UPCAST(PCIESlot, port, DO_UPCAST(PCIEPort, br, br)); } diff --git a/hw/xio3130_downstream.c b/hw/xio3130_downstream.c index 1a2d258..83394ab 100644 --- a/hw/xio3130_downstream.c +++ b/hw/xio3130_downstream.c @@ -153,6 +153,10 @@ PCIESlot *xio3130_downstream_init(PCIBus *bus, int devfn, bool multifunction, qdev_prop_set_uint16(qdev, "slot", slot); qdev_init_nofail(qdev); + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(qdev, "x3130-downstream", qdev); + return DO_UPCAST(PCIESlot, port, DO_UPCAST(PCIEPort, br, br)); } diff --git a/hw/xio3130_upstream.c b/hw/xio3130_upstream.c index 387bf6c..cbd126a 100644 --- a/hw/xio3130_upstream.c +++ b/hw/xio3130_upstream.c @@ -134,6 +134,10 @@ PCIEPort *xio3130_upstream_init(PCIBus *bus, int devfn, bool multifunction, qdev_prop_set_uint8(qdev, "port", port); qdev_init_nofail(qdev); + /* TODO: p2p bridge migration. pcibus_get_dev_path() isn't migration-safe. + remove this once p2p bridge migration is supported */ + register_device_unmigratable(qdev, "x3130-upstream", qdev); + return DO_UPCAST(PCIEPort, br, br); }