From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wen Congyang Subject: Re: [PATCHv2-RFC 0/2] RFC: standard pci bridge device Date: Mon, 13 Feb 2012 17:38:26 +0800 Message-ID: <4F38DA12.30406@cn.fujitsu.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity , Kevin Wolf , Anthony Liguori , Isaku Yamahata , berrange@redhat.com To: "Michael S. Tsirkin" Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:50970 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756427Ab2BMJfn (ORCPT ); Mon, 13 Feb 2012 04:35:43 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: At 02/13/2012 05:15 PM, Michael S. Tsirkin Wrote: > Here's a new version of the patch. It works for me. > Deep nesting of bridges is supported. > You need a small BIOS patch to support the OSHP method > if you want hotplug to work. I will post this separately. > We'd need a full ACPI driver to make hotplug work for guests > without an SHPC driver (e.g. windows XP). > Management support will also be needed. > > One small wrinkle is that the pci_addr property > wants data in a format bus:device.function which is > broken as guests can change bus numbers. > For testing I used the 'addr' property which > encodes slot*8+function#. We probably want to > extend pci_addr in some way (e.g. :device.function ? > Thoughts?). What about using id+device(slot)+function to set the address? > > The SHPC controller supports up to 31 devices > (out of 32 slots) so slot 0 doesn't support hotplug. > Non hot-pluggable devices behind the bridge > don't work currectly (we'll try to unplug them) > so don't do this. > For now I just blocked adding devices in slot 0, > in the future it might be possible to add > a non-hotpluggable device there. > > Example: > > qemu-system-x86_64 -enable-kvm -m 1G > -drive file=/home/mst/rhel6.qcow2 > -netdev > tap,id=foo,ifname=msttap0,script=/home/mst/ifup,downscript=no,vhost=on > -device pci-bridge,id=bog > -device virtio-net-pci,netdev=foo,bus=bog,addr=8 > > > Hot-unplug currently causes qemu to crash, this > happens without this patch too, so I'm not worried :) How to trigger this bug without this patch? Thanks Wen Congyang > > New since v1: > hotplug support > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwsKD-0007Ir-AY for qemu-devel@nongnu.org; Mon, 13 Feb 2012 04:36:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwsK7-0000RP-NP for qemu-devel@nongnu.org; Mon, 13 Feb 2012 04:35:57 -0500 Received: from [222.73.24.84] (port=53427 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwsK7-0000Qr-66 for qemu-devel@nongnu.org; Mon, 13 Feb 2012 04:35:51 -0500 Message-ID: <4F38DA12.30406@cn.fujitsu.com> Date: Mon, 13 Feb 2012 17:38:26 +0800 From: Wen Congyang MIME-Version: 1.0 References: In-Reply-To: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [PATCHv2-RFC 0/2] RFC: standard pci bridge device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Kevin Wolf , kvm@vger.kernel.org, qemu-devel@nongnu.org, Isaku Yamahata , Avi Kivity At 02/13/2012 05:15 PM, Michael S. Tsirkin Wrote: > Here's a new version of the patch. It works for me. > Deep nesting of bridges is supported. > You need a small BIOS patch to support the OSHP method > if you want hotplug to work. I will post this separately. > We'd need a full ACPI driver to make hotplug work for guests > without an SHPC driver (e.g. windows XP). > Management support will also be needed. > > One small wrinkle is that the pci_addr property > wants data in a format bus:device.function which is > broken as guests can change bus numbers. > For testing I used the 'addr' property which > encodes slot*8+function#. We probably want to > extend pci_addr in some way (e.g. :device.function ? > Thoughts?). What about using id+device(slot)+function to set the address? > > The SHPC controller supports up to 31 devices > (out of 32 slots) so slot 0 doesn't support hotplug. > Non hot-pluggable devices behind the bridge > don't work currectly (we'll try to unplug them) > so don't do this. > For now I just blocked adding devices in slot 0, > in the future it might be possible to add > a non-hotpluggable device there. > > Example: > > qemu-system-x86_64 -enable-kvm -m 1G > -drive file=/home/mst/rhel6.qcow2 > -netdev > tap,id=foo,ifname=msttap0,script=/home/mst/ifup,downscript=no,vhost=on > -device pci-bridge,id=bog > -device virtio-net-pci,netdev=foo,bus=bog,addr=8 > > > Hot-unplug currently causes qemu to crash, this > happens without this patch too, so I'm not worried :) How to trigger this bug without this patch? Thanks Wen Congyang > > New since v1: > hotplug support >