@@ -28,7 +28,7 @@ every detail. More information/reference could be found here:
2828 https://en.wikipedia.org/wiki/Channel_I/O
2929- s390 architecture:
3030 s390 Principles of Operation manual (IBM Form. No. SA22-7832)
31- - The existing Qemu code which implements a simple emulated channel
31+ - The existing QEMU code which implements a simple emulated channel
3232 subsystem could also be a good reference. It makes it easier to follow
3333 the flow.
3434 qemu/hw/s390x/css.c
@@ -39,22 +39,22 @@ For vfio mediated device framework:
3939Motivation of vfio-ccw
4040----------------------
4141
42- Currently , a guest virtualized via qemu/kvm on s390 only sees
42+ Typically , a guest virtualized via QEMU/KVM on s390 only sees
4343paravirtualized virtio devices via the "Virtio Over Channel I/O
4444(virtio-ccw)" transport. This makes virtio devices discoverable via
4545standard operating system algorithms for handling channel devices.
4646
4747However this is not enough. On s390 for the majority of devices, which
4848use the standard Channel I/O based mechanism, we also need to provide
49- the functionality of passing through them to a Qemu virtual machine.
49+ the functionality of passing through them to a QEMU virtual machine.
5050This includes devices that don't have a virtio counterpart (e.g. tape
5151drives) or that have specific characteristics which guests want to
5252exploit.
5353
5454For passing a device to a guest, we want to use the same interface as
55- everybody else, namely vfio. Thus, we would like to introduce vfio
56- support for channel devices. And we would like to name this new vfio
57- device "vfio-ccw ".
55+ everybody else, namely vfio. We implement this vfio support for channel
56+ devices via the vfio mediated device framework and the subchannel device
57+ driver "vfio_ccw ".
5858
5959Access patterns of CCW devices
6060------------------------------
@@ -99,7 +99,7 @@ As mentioned above, we realize vfio-ccw with a mdev implementation.
9999Channel I/O does not have IOMMU hardware support, so the physical
100100vfio-ccw device does not have an IOMMU level translation or isolation.
101101
102- Sub-channel I/O instructions are all privileged instructions, When
102+ Subchannel I/O instructions are all privileged instructions. When
103103handling the I/O instruction interception, vfio-ccw has the software
104104policing and translation how the channel program is programmed before
105105it gets sent to hardware.
@@ -121,7 +121,7 @@ devices:
121121- The vfio_mdev driver for the mediated vfio ccw device.
122122 This is provided by the mdev framework. It is a vfio device driver for
123123 the mdev that created by vfio_ccw.
124- It realize a group of vfio device driver callbacks, adds itself to a
124+ It realizes a group of vfio device driver callbacks, adds itself to a
125125 vfio group, and registers itself to the mdev framework as a mdev
126126 driver.
127127 It uses a vfio iommu backend that uses the existing map and unmap
@@ -178,7 +178,7 @@ vfio-ccw I/O region
178178
179179An I/O region is used to accept channel program request from user
180180space and store I/O interrupt result for user space to retrieve. The
181- defination of the region is:
181+ definition of the region is:
182182
183183struct ccw_io_region {
184184#define ORB_AREA_SIZE 12
@@ -198,30 +198,23 @@ irb_area stores the I/O result.
198198
199199ret_code stores a return code for each access of the region.
200200
201- vfio-ccw patches overview
202- -------------------------
201+ vfio-ccw operation details
202+ --------------------------
203203
204- For now, our patches are rebased on the latest mdev implementation.
205- vfio-ccw follows what vfio-pci did on the s390 paltform and uses
206- vfio-iommu-type1 as the vfio iommu backend. It's a good start to launch
207- the code review for vfio-ccw. Note that the implementation is far from
208- complete yet; but we'd like to get feedback for the general
209- architecture.
204+ vfio-ccw follows what vfio-pci did on the s390 platform and uses
205+ vfio-iommu-type1 as the vfio iommu backend.
210206
211207* CCW translation APIs
212- - Description:
213- These introduce a group of APIs (start with 'cp_') to do CCW
214- translation. The CCWs passed in by a user space program are
215- organized with their guest physical memory addresses. These APIs
216- will copy the CCWs into the kernel space, and assemble a runnable
217- kernel channel program by updating the guest physical addresses with
218- their corresponding host physical addresses.
219- - Patches:
220- vfio: ccw: introduce channel program interfaces
208+ A group of APIs (start with 'cp_') to do CCW translation. The CCWs
209+ passed in by a user space program are organized with their guest
210+ physical memory addresses. These APIs will copy the CCWs into kernel
211+ space, and assemble a runnable kernel channel program by updating the
212+ guest physical addresses with their corresponding host physical addresses.
213+ Note that we have to use IDALs even for direct-access CCWs, as the
214+ referenced memory can be located anywhere, including above 2G.
221215
222216* vfio_ccw device driver
223- - Description:
224- The following patches utilizes the CCW translation APIs and introduce
217+ This driver utilizes the CCW translation APIs and introduces
225218 vfio_ccw, which is the driver for the I/O subchannel devices you want
226219 to pass through.
227220 vfio_ccw implements the following vfio ioctls:
@@ -236,20 +229,14 @@ architecture.
236229 This also provides the SET_IRQ ioctl to setup an event notifier to
237230 notify the user space program the I/O completion in an asynchronous
238231 way.
239- - Patches:
240- vfio: ccw: basic implementation for vfio_ccw driver
241- vfio: ccw: introduce ccw_io_region
242- vfio: ccw: realize VFIO_DEVICE_GET_REGION_INFO ioctl
243- vfio: ccw: realize VFIO_DEVICE_RESET ioctl
244- vfio: ccw: realize VFIO_DEVICE_G(S)ET_IRQ_INFO ioctls
245-
246- The user of vfio-ccw is not limited to Qemu, while Qemu is definitely a
232+
233+ The use of vfio-ccw is not limited to QEMU, while QEMU is definitely a
247234good example to get understand how these patches work. Here is a little
248- bit more detail how an I/O request triggered by the Qemu guest will be
235+ bit more detail how an I/O request triggered by the QEMU guest will be
249236handled (without error handling).
250237
251238Explanation:
252- Q1-Q7: Qemu side process.
239+ Q1-Q7: QEMU side process.
253240K1-K5: Kernel side process.
254241
255242Q1. Get I/O region info during initialization.
@@ -263,15 +250,15 @@ Q4. Write the guest channel program and ORB to the I/O region.
263250 K2. Translate the guest channel program to a host kernel space
264251 channel program, which becomes runnable for a real device.
265252 K3. With the necessary information contained in the orb passed in
266- by Qemu , issue the ccwchain to the device.
253+ by QEMU , issue the ccwchain to the device.
267254 K4. Return the ssch CC code.
268255Q5. Return the CC code to the guest.
269256
270257... ...
271258
272259 K5. Interrupt handler gets the I/O result and write the result to
273260 the I/O region.
274- K6. Signal Qemu to retrieve the result.
261+ K6. Signal QEMU to retrieve the result.
275262Q6. Get the signal and event handler reads out the result from the I/O
276263 region.
277264Q7. Update the irb for the guest.
@@ -289,10 +276,20 @@ More information for DASD and ECKD could be found here:
289276https://en.wikipedia.org/wiki/Direct-access_storage_device
290277https://en.wikipedia.org/wiki/Count_key_data
291278
292- Together with the corresponding work in Qemu , we can bring the passed
279+ Together with the corresponding work in QEMU , we can bring the passed
293280through DASD/ECKD device online in a guest now and use it as a block
294281device.
295282
283+ While the current code allows the guest to start channel programs via
284+ START SUBCHANNEL, support for HALT SUBCHANNEL or CLEAR SUBCHANNEL is
285+ not yet implemented.
286+
287+ vfio-ccw supports classic (command mode) channel I/O only. Transport
288+ mode (HPF) is not supported.
289+
290+ QDIO subchannels are currently not supported. Classic devices other than
291+ DASD/ECKD might work, but have not been tested.
292+
296293Reference
297294---------
2982951. ESA/s390 Principles of Operation manual (IBM Form. No. SA22-7832)
0 commit comments