Received: from eggs.gnu.org ([2001:4830:134:3::10]:58739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPpaw-0004mn-Pu for qemu-devel@nongnu.org; Wed, 20 Jul 2016 07:23:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPpas-0007Dw-O1 for qemu-devel@nongnu.org; Wed, 20 Jul 2016 07:23:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPpas-0007D4-Fp for qemu-devel@nongnu.org; Wed, 20 Jul 2016 07:23:14 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6KBMmRv121487 for ; Wed, 20 Jul 2016 07:23:11 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2495rau0tj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 20 Jul 2016 07:23:10 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jul 2016 12:23:08 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 231B41B0805F for ; Wed, 20 Jul 2016 12:24:29 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6KBN49j20906338 for ; Wed, 20 Jul 2016 11:23:04 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6KBN4cd025256 for ; Wed, 20 Jul 2016 05:23:04 -0600 Date: Wed, 20 Jul 2016 13:23:03 +0200 From: Cornelia Huck In-Reply-To: <578F4668.4050402@redhat.com> References: <1468953778-15295-1-git-send-email-marcel@redhat.com> <20160720111604.1573d0b7.cornelia.huck@de.ibm.com> <578F4668.4050402@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160720132303.0a61a7f4.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH V2] hw/virtio-pci: fix virtio behaviour on modern (PCIe) machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, mst@redhat.com On Wed, 20 Jul 2016 12:37:44 +0300 Marcel Apfelbaum wrote: > On 07/20/2016 12:16 PM, Cornelia Huck wrote: > > On Tue, 19 Jul 2016 21:42:58 +0300 > > Marcel Apfelbaum wrote: > > > >> Modern machines are expected to be used by newer setups with > >> modern guests aiming the use of the latest features. > >> > >> Enable modern and disable legacy for virtio devices > >> plugged into PCIe ports (Root ports or Downstream ports). > >> Using the Virtio 1 mode will remove the limitation > >> of the number of devices that can be attached to a machine > >> by removing the need for the IO BAR. > > > > Hi Cornelia, > > > Stupid question: Does this limitation show up for legacy and > > transitional, but not for modern? > > > > Yes, with PCIe we need to disable the IO Bars. > > Here is a short explanation: > The root cause it the PCIe architecture being "point to point" rather than 'shared bus'. > Each PCIe port supports only one device (multiple functions though) but is exposed > as a PCI bridge. The firmware will assign a 4k IO window for each bridge if > a device with IO BARs is attached to it. > > So the firmware will allocate a 4K IO range for each PCIe port -> for each device. > Since the IO space is pretty limited we can support around 15 devices with IO BARs > attached to PCIe ports. > > There are other ways to deal with the limitation like tweaking the firmware > to assign a smaller IO window (no PCI compliant, but it should work) Thanks for the explanation! > > Looking only at the virtio scope, disabling legacy and enabling modern > should be enough. > > > Would it make sense then to default to modern for PCIe and transitional > > for non-PCIe? > > > > Yes. this patch only does the first part (deals only with the PCIe limitation), > but the next version will also include 'transitional' virtio as default for non PCIe slots. OK, sounds sensible. The transport-agnostic virtio-1 code should be pretty sane at this point.