From: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com,
Yi Min Zhao <zyimin@linux.vnet.ibm.com>,
agraf@suse.de, mst@redhat.com
Subject: [Qemu-devel] [PATCH v5 0/1] s390 pci infrastructure modeling
Date: Thu, 20 Aug 2015 17:22:23 +0800 [thread overview]
Message-ID: <1440062544-13960-1-git-send-email-zyimin@linux.vnet.ibm.com> (raw)
From: Yi Min Zhao <zyimin@linux.vnet.ibm.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.
The new design allows to define multiple host bridges, each host bridge
could hold 32 zpci devices at most. Add a new property named index to
s390-pcihost device and must assign a unique value to it in qemu command
line.
The topology for this implementation could be:
dev: s390-pcihost, id ""
index=1
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 v4, this patch does the following change:
1.Add index property to s390-pcihost device.
2.Add index to s390PCIBusDevice. Its value is assigned by logical
OR s390-pcihost device's index and pci slot.
3.Add three usable macros to get zpci index and s390pcihost index.
4.Add a bool member to s390PCIBustDevice named "available" to judge
whether the relationship of zpci and vfio pci is established.
This change fixed a bug generated by previous code in case that
only define zpci device and then hot unplug it will fail.
5.Rework s390_pci_find_dev_by_idx function.
6.Rework s390_pci_device_hot_unplug_request function to be more
stable.
7.Rework s390_pci_device_unrealize function to make the process of
pci device unplug more logical and stable.
Comparing to v3, this patch does the following change:
1.Exchange vfio-pci and zpci definitions. Define zpci device firstly
then define vfio-pci device.
2.Unplug either vfio-pci device or zpci device can remove both of them.
Yi Min Zhao (1):
s390x: pci infrastructure modeling
hw/s390x/s390-pci-bus.c | 379 ++++++++++++++++++++++++++++++++++----------
hw/s390x/s390-pci-bus.h | 54 ++++++-
hw/s390x/s390-pci-inst.c | 80 ++++++----
hw/s390x/s390-virtio-ccw.c | 5 +-
4 files changed, 392 insertions(+), 126 deletions(-)
--
1.7.9
next reply other threads:[~2015-08-20 9:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 9:22 Yi Min Zhao [this message]
2015-08-20 9:22 ` [Qemu-devel] [PATCH v5 1/1] s390x: pci infrastructure modeling Yi Min Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1440062544-13960-1-git-send-email-zyimin@linux.vnet.ibm.com \
--to=zyimin@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).