From: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
To: kvm@vger.kernel.org, linux-s390@vger.kernel.org, qemu-devel@nongnu.org
Cc: bjsdjshi@linux.vnet.ibm.com, renxiaof@linux.vnet.ibm.com,
cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, agraf@suse.com,
alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com,
pasic@linux.vnet.ibm.com, wkywang@linux.vnet.ibm.com
Subject: [PATCH RFC v2 00/12] basic channel IO passthrough infrastructure based on vfio
Date: Thu, 12 Jan 2017 08:25:01 +0100 [thread overview]
Message-ID: <20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com> (raw)
The patch series introduce a basic channel I/O passthrough
infrastructure based on vfio.
- Focus on supporting dasd-eckd(cu_type/dev_type = 0x3990/0x3390) as
the target device.
- Support new qemu parameters in the style of:
"-machine s390-ccw-virtio(,s390-map-css=on|off) ...
-device vfio-ccw,id=xx,hostid=xx(,guestid=xx),mdevid=xx".
We want to support real (i.e. not virtual) channel devices even for
guests that do not support MCSS-E (where guests may see devices from
any channel subsystem image at once). As all virtio-ccw devices are in
css 0xfe (and show up in the default css 0 for guests not activating
MCSS-E), we need an option to map e.g. passed-through channel devices
from their real css (0-3, or 0 for hosts not activating MCSS-E) into
the default css, that is what the new machine option s390-map-css is
added.
Build and install:
1. kernel configuration
CONFIG_S390_CCW_IOMMU=m
CONFIG_VFIO=m
CONFIG_VFIO_MDEV=m
CONFIG_VFIO_MDEV_DEVICE=m
CONFIG_VFIO_CCW=m
2. modules required
modprobe vfio.ko
modprobe mdev.ko
modprobe vfio_mdev.ko
modprobe vfio_iommu_type1.ko
modprobe vfio_ccw.ko
3. find a subchannel(0.0."%schid") of a DASD-ECKD device and bind it to
vfio_ccw driver
#find the dasd you can use with lsdasd on your host. e.g.:
devno="7e52"
schid="16ca"
#unbind the ccw device from the subchannel
echo 0.0."$devno" > /sys/bus/ccw/devices/0.0."$devno"/driver/unbind
#unbind the subchannel from io_subchannel driver
echo 0.0."$schid" > /sys/bus/css/devices/0.0."$schid"/driver/unbind
#bind the subchannel with vfio_ccw driver
echo 0.0."$schid" > /sys/bus/css/drivers/vfio_ccw/bind
4. create a mediated device
#generate a uuid with uuidgen. e.g.:
uuid="6dfd3ec5-e8b3-4e18-a6fe-57bc9eceb920"
echo "$uuid" > \
/sys/bus/css/devices/0.0."$schid"/mdev_supported_types/vfio_ccw-io/create
5. pass-through this device to a vm
-M s390-ccw-virtio,s390-map-css=on \
-device vfio-ccw,id=pass0, \
hostid=0.0."$schid",guestid=0.0.1234, \
mdevid="$uuid" \
... ...
Change log:
v1 -> v2:
1. Rebase the implementation to the mdev framework approach.
2. Use pread and pwrite on an I/O region to issue I/O requests and
receive results.
Dong Jia Shi (4):
update-linux-headers: add asm-s390/vfio_ccw.h
s390x/css: realize css_create_sch
vfio/ccw: get io region info
vfio/ccw: update sense data if a unit check is pending
Xiao Feng Ren (8):
vfio: linux-headers update for vfio-ccw
s390x/css: add s390-map-css machine option
s390x/css: realize css_sch_build_schib
s390x/css: device support for s390-ccw passthrough
vfio/ccw: vfio based subchannel passthrough driver
vfio/ccw: get irqs info and set the eventfd fd
s390x/css: introduce and realize ccw-request callback
s390x/css: ccws translation infrastructure
default-configs/s390x-softmmu.mak | 1 +
hw/s390x/Makefile.objs | 1 +
hw/s390x/css-bridge.c | 3 +
hw/s390x/css.c | 283 ++++++++++++++++-
hw/s390x/s390-ccw.c | 132 ++++++++
hw/s390x/s390-ccw.h | 39 +++
hw/s390x/s390-virtio-ccw.c | 23 ++
hw/s390x/virtio-ccw.c | 1 +
hw/vfio/Makefile.objs | 1 +
hw/vfio/ccw.c | 443 +++++++++++++++++++++++++++
include/hw/s390x/css-bridge.h | 1 +
include/hw/s390x/css.h | 57 +++-
include/hw/s390x/s390-virtio-ccw.h | 1 +
include/hw/vfio/vfio-common.h | 1 +
include/standard-headers/asm-s390/vfio_ccw.h | 28 ++
linux-headers/linux/vfio.h | 17 +
qemu-options.hx | 6 +-
scripts/update-linux-headers.sh | 1 +
target-s390x/cpu.h | 10 +
target-s390x/ioinst.c | 9 +
20 files changed, 1029 insertions(+), 29 deletions(-)
create mode 100644 hw/s390x/s390-ccw.c
create mode 100644 hw/s390x/s390-ccw.h
create mode 100644 hw/vfio/ccw.c
create mode 100644 include/standard-headers/asm-s390/vfio_ccw.h
--
2.8.4
next reply other threads:[~2017-01-12 7:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 7:25 Dong Jia Shi [this message]
2017-01-12 7:25 ` [PATCH RFC v2 01/12] update-linux-headers: add asm-s390/vfio_ccw.h Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 02/12] vfio: linux-headers update for vfio-ccw Dong Jia Shi
2017-01-17 21:51 ` Alex Williamson
2017-01-18 2:51 ` Dong Jia Shi
[not found] ` <20170118025117.GN30301@bjsdjshi@linux.vnet.ibm.com>
2017-01-18 12:41 ` Cornelia Huck
2017-01-18 20:43 ` Alex Williamson
2017-01-19 1:54 ` Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 03/12] s390x/css: add s390-map-css machine option Dong Jia Shi
2017-02-17 2:08 ` Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 04/12] s390x/css: realize css_sch_build_schib Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 05/12] s390x/css: realize css_create_sch Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 06/12] s390x/css: device support for s390-ccw passthrough Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 07/12] vfio/ccw: vfio based subchannel passthrough driver Dong Jia Shi
2017-01-17 22:49 ` Alex Williamson
2017-01-18 3:22 ` Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 08/12] vfio/ccw: get io region info Dong Jia Shi
2017-01-17 22:49 ` Alex Williamson
2017-01-18 5:22 ` Dong Jia Shi
[not found] ` <20170118052256.GP30301@bjsdjshi@linux.vnet.ibm.com>
2017-01-18 5:51 ` Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 09/12] vfio/ccw: get irqs info and set the eventfd fd Dong Jia Shi
2017-01-17 22:53 ` Alex Williamson
2017-01-18 5:55 ` Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 10/12] s390x/css: introduce and realize ccw-request callback Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 11/12] s390x/css: ccws translation infrastructure Dong Jia Shi
2017-01-12 7:25 ` [PATCH RFC v2 12/12] vfio/ccw: update sense data if a unit check is pending Dong Jia Shi
2017-01-12 8:00 ` [Qemu-devel] [PATCH RFC v2 00/12] basic channel IO passthrough infrastructure based on vfio no-reply
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=20170112072513.98411-1-bjsdjshi@linux.vnet.ibm.com \
--to=bjsdjshi@linux.vnet.ibm.com \
--cc=agraf@suse.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.vnet.ibm.com \
--cc=pmorel@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=renxiaof@linux.vnet.ibm.com \
--cc=wkywang@linux.vnet.ibm.com \
/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