From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0Jr-0001qT-C4 for qemu-devel@nongnu.org; Fri, 03 Jul 2015 08:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZB0Jo-00056C-Lr for qemu-devel@nongnu.org; Fri, 03 Jul 2015 08:43:51 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:46131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB0Jo-00055j-0B for qemu-devel@nongnu.org; Fri, 03 Jul 2015 08:43:48 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Jul 2015 18:13:43 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 6474D3940066 for ; Fri, 3 Jul 2015 18:13:39 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t63ChZr362259330 for ; Fri, 3 Jul 2015 18:13:37 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t63ChYof004397 for ; Fri, 3 Jul 2015 18:13:34 +0530 From: Hong Bo Li Date: Fri, 3 Jul 2015 20:43:11 +0800 Message-Id: <1435927392-8856-1-git-send-email-lihbbj@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v3 0/1] s390 pci infrastructure modelling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, agraf@suse.de, Hong Bo Li , mst@redhat.com This patch extends the current s390 pci implementation to provide more flexibility in configuration of s390 specific device handling. For each vfio pci device, I create a zpci device to store s390 specific informations. And attach all of these special zpci devices to the s390 facility bus. A zpci device references the corresponding PCI device via device id. Compare to the old implementation, I moved the actual hotplug/unplug codes to s390 pci device hot plug function. Then in the pcihost hotplug function, we don't need to do anything special. In the pcihost unplug function, we need to unplug the corresponding zpci device. The new design allows to define multiple host bridges, each host bridge could hold 32 zpci devices at most. The topology for this implementation could be: dev: s390-pcihost, id "" bus: pci.0 type PCI dev: vfio-pci, id "vpci1" host = "0000:00:00.0" ...... dev: vfio-pci, id "vpci2" host = "0001:00:00.0" ...... dev: s390-pci-facility, id "" bus: s390-pci-fac-bus.0 type s390-pci-fac-bus dev: zpci, id "zpci1" fid = 1 (0x1) uid = 2 (0x2) pci_id = "vpci1" dev: zpci, id "zpci2" fid = 6 (0x6) uid = 7 (0x7) pci_id = "vpci2" To make the review easier, I keep all of the old names, such as S390PCIBusDevice to name a zpci device. I will make a cleanup patch later to change these names to a more suitable name. Comparing to v2, this patch does the following change: 1.use a link list to store all the zpci devices, and sort them by fid. 2.add a flag "token_valid" to mark whether the list zpci instruction should restart or not. Hong Bo Li (1): s390 pci infrastructure modelling hw/s390x/s390-pci-bus.c | 316 +++++++++++++++++++++++++++++++++------------ hw/s390x/s390-pci-bus.h | 41 +++++- hw/s390x/s390-pci-inst.c | 12 +- hw/s390x/s390-virtio-ccw.c | 5 +- 4 files changed, 287 insertions(+), 87 deletions(-) -- 1.9.3