2 * vfio based subchannel assignment support
4 * Copyright 2017 IBM Corp.
5 * Copyright 2019 Red Hat, Inc.
7 * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
8 * Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
9 * Pierre Morel <pmorel@linux.vnet.ibm.com>
10 * Cornelia Huck <cohuck@redhat.com>
12 * This work is licensed under the terms of the GNU GPL, version 2 or (at
13 * your option) any later version. See the COPYING file in the top-level
17 #include "qemu/osdep.h"
18 #include <linux/vfio.h>
19 #include <linux/vfio_ccw.h>
20 #include <sys/ioctl.h>
22 #include "qapi/error.h"
23 #include "hw/vfio/vfio-common.h"
24 #include "hw/s390x/s390-ccw.h"
25 #include "hw/s390x/vfio-ccw.h"
26 #include "hw/qdev-properties.h"
27 #include "hw/s390x/ccw-device.h"
28 #include "exec/address-spaces.h"
29 #include "qemu/error-report.h"
30 #include "qemu/main-loop.h"
31 #include "qemu/module.h"
33 struct VFIOCCWDevice
{
36 uint64_t io_region_size
;
37 uint64_t io_region_offset
;
38 struct ccw_io_region
*io_region
;
39 uint64_t async_cmd_region_size
;
40 uint64_t async_cmd_region_offset
;
41 struct ccw_cmd_region
*async_cmd_region
;
42 uint64_t schib_region_size
;
43 uint64_t schib_region_offset
;
44 struct ccw_schib_region
*schib_region
;
45 uint64_t crw_region_size
;
46 uint64_t crw_region_offset
;
47 struct ccw_crw_region
*crw_region
;
48 EventNotifier io_notifier
;
49 EventNotifier crw_notifier
;
50 EventNotifier req_notifier
;
55 static inline void warn_once_pfch(VFIOCCWDevice
*vcdev
, SubchDev
*sch
,
58 warn_report_once_cond(&vcdev
->warned_orb_pfch
,
59 "vfio-ccw (devno %x.%x.%04x): %s",
60 sch
->cssid
, sch
->ssid
, sch
->devno
, msg
);
63 static void vfio_ccw_compute_needs_reset(VFIODevice
*vdev
)
65 vdev
->needs_reset
= false;
69 * We don't need vfio_hot_reset_multi and vfio_eoi operations for
70 * vfio_ccw device now.
72 struct VFIODeviceOps vfio_ccw_ops
= {
73 .vfio_compute_needs_reset
= vfio_ccw_compute_needs_reset
,
76 static IOInstEnding
vfio_ccw_handle_request(SubchDev
*sch
)
78 VFIOCCWDevice
*vcdev
= VFIO_CCW(sch
->driver_data
);
79 struct ccw_io_region
*region
= vcdev
->io_region
;
82 if (!(sch
->orb
.ctrl0
& ORB_CTRL0_MASK_PFCH
) && vcdev
->force_orb_pfch
) {
83 sch
->orb
.ctrl0
|= ORB_CTRL0_MASK_PFCH
;
84 warn_once_pfch(vcdev
, sch
, "PFCH flag forced");
87 QEMU_BUILD_BUG_ON(sizeof(region
->orb_area
) != sizeof(ORB
));
88 QEMU_BUILD_BUG_ON(sizeof(region
->scsw_area
) != sizeof(SCSW
));
89 QEMU_BUILD_BUG_ON(sizeof(region
->irb_area
) != sizeof(IRB
));
91 memset(region
, 0, sizeof(*region
));
93 memcpy(region
->orb_area
, &sch
->orb
, sizeof(ORB
));
94 memcpy(region
->scsw_area
, &sch
->curr_status
.scsw
, sizeof(SCSW
));
97 ret
= pwrite(vcdev
->vdev
.fd
, region
,
98 vcdev
->io_region_size
, vcdev
->io_region_offset
);
99 if (ret
!= vcdev
->io_region_size
) {
100 if (errno
== EAGAIN
) {
103 error_report("vfio-ccw: write I/O region failed with errno=%d", errno
);
104 ret
= errno
? -errno
: -EFAULT
;
110 return IOINST_CC_EXPECTED
;
112 return IOINST_CC_BUSY
;
115 return IOINST_CC_NOT_OPERATIONAL
;
118 sch_gen_unit_exception(sch
);
119 css_inject_io_interrupt(sch
);
120 return IOINST_CC_EXPECTED
;
124 static IOInstEnding
vfio_ccw_handle_store(SubchDev
*sch
)
126 VFIOCCWDevice
*vcdev
= VFIO_CCW(sch
->driver_data
);
127 SCHIB
*schib
= &sch
->curr_status
;
128 struct ccw_schib_region
*region
= vcdev
->schib_region
;
132 /* schib region not available so nothing else to do */
134 return IOINST_CC_EXPECTED
;
137 memset(region
, 0, sizeof(*region
));
138 ret
= pread(vcdev
->vdev
.fd
, region
, vcdev
->schib_region_size
,
139 vcdev
->schib_region_offset
);
143 * Device is probably damaged, but store subchannel does not
144 * have a nonzero cc defined for this scenario. Log an error,
145 * and presume things are otherwise fine.
147 error_report("vfio-ccw: store region read failed with errno=%d", errno
);
148 return IOINST_CC_EXPECTED
;
152 * Selectively copy path-related bits of the SCHIB,
153 * rather than copying the entire struct.
155 s
= (SCHIB
*)region
->schib_area
;
156 schib
->pmcw
.pnom
= s
->pmcw
.pnom
;
157 schib
->pmcw
.lpum
= s
->pmcw
.lpum
;
158 schib
->pmcw
.pam
= s
->pmcw
.pam
;
159 schib
->pmcw
.pom
= s
->pmcw
.pom
;
161 if (s
->scsw
.flags
& SCSW_FLAGS_MASK_PNO
) {
162 schib
->scsw
.flags
|= SCSW_FLAGS_MASK_PNO
;
165 return IOINST_CC_EXPECTED
;
168 static int vfio_ccw_handle_clear(SubchDev
*sch
)
170 VFIOCCWDevice
*vcdev
= VFIO_CCW(sch
->driver_data
);
171 struct ccw_cmd_region
*region
= vcdev
->async_cmd_region
;
174 if (!vcdev
->async_cmd_region
) {
175 /* Async command region not available, fall back to emulation */
179 memset(region
, 0, sizeof(*region
));
180 region
->command
= VFIO_CCW_ASYNC_CMD_CSCH
;
183 ret
= pwrite(vcdev
->vdev
.fd
, region
,
184 vcdev
->async_cmd_region_size
, vcdev
->async_cmd_region_offset
);
185 if (ret
!= vcdev
->async_cmd_region_size
) {
186 if (errno
== EAGAIN
) {
189 error_report("vfio-ccw: write cmd region failed with errno=%d", errno
);
190 ret
= errno
? -errno
: -EFAULT
;
201 sch_gen_unit_exception(sch
);
202 css_inject_io_interrupt(sch
);
207 static int vfio_ccw_handle_halt(SubchDev
*sch
)
209 VFIOCCWDevice
*vcdev
= VFIO_CCW(sch
->driver_data
);
210 struct ccw_cmd_region
*region
= vcdev
->async_cmd_region
;
213 if (!vcdev
->async_cmd_region
) {
214 /* Async command region not available, fall back to emulation */
218 memset(region
, 0, sizeof(*region
));
219 region
->command
= VFIO_CCW_ASYNC_CMD_HSCH
;
222 ret
= pwrite(vcdev
->vdev
.fd
, region
,
223 vcdev
->async_cmd_region_size
, vcdev
->async_cmd_region_offset
);
224 if (ret
!= vcdev
->async_cmd_region_size
) {
225 if (errno
== EAGAIN
) {
228 error_report("vfio-ccw: write cmd region failed with errno=%d", errno
);
229 ret
= errno
? -errno
: -EFAULT
;
241 sch_gen_unit_exception(sch
);
242 css_inject_io_interrupt(sch
);
247 static void vfio_ccw_reset(DeviceState
*dev
)
249 VFIOCCWDevice
*vcdev
= VFIO_CCW(dev
);
251 ioctl(vcdev
->vdev
.fd
, VFIO_DEVICE_RESET
);
254 static void vfio_ccw_crw_read(VFIOCCWDevice
*vcdev
)
256 struct ccw_crw_region
*region
= vcdev
->crw_region
;
260 /* Keep reading CRWs as long as data is returned */
262 memset(region
, 0, sizeof(*region
));
263 size
= pread(vcdev
->vdev
.fd
, region
, vcdev
->crw_region_size
,
264 vcdev
->crw_region_offset
);
267 error_report("vfio-ccw: Read crw region failed with errno=%d",
272 if (region
->crw
== 0) {
273 /* No more CRWs to queue */
277 memcpy(&crw
, ®ion
->crw
, sizeof(CRW
));
279 css_crw_add_to_queue(crw
);
283 static void vfio_ccw_req_notifier_handler(void *opaque
)
285 VFIOCCWDevice
*vcdev
= opaque
;
288 if (!event_notifier_test_and_clear(&vcdev
->req_notifier
)) {
292 qdev_unplug(DEVICE(vcdev
), &err
);
294 warn_reportf_err(err
, VFIO_MSG_PREFIX
, vcdev
->vdev
.name
);
298 static void vfio_ccw_crw_notifier_handler(void *opaque
)
300 VFIOCCWDevice
*vcdev
= opaque
;
302 while (event_notifier_test_and_clear(&vcdev
->crw_notifier
)) {
303 vfio_ccw_crw_read(vcdev
);
307 static void vfio_ccw_io_notifier_handler(void *opaque
)
309 VFIOCCWDevice
*vcdev
= opaque
;
310 struct ccw_io_region
*region
= vcdev
->io_region
;
311 CcwDevice
*ccw_dev
= CCW_DEVICE(vcdev
);
312 SubchDev
*sch
= ccw_dev
->sch
;
313 SCHIB
*schib
= &sch
->curr_status
;
319 if (!event_notifier_test_and_clear(&vcdev
->io_notifier
)) {
323 size
= pread(vcdev
->vdev
.fd
, region
, vcdev
->io_region_size
,
324 vcdev
->io_region_offset
);
328 /* Generate a deferred cc 3 condition. */
329 schib
->scsw
.flags
|= SCSW_FLAGS_MASK_CC
;
330 schib
->scsw
.ctrl
&= ~SCSW_CTRL_MASK_STCTL
;
331 schib
->scsw
.ctrl
|= (SCSW_STCTL_ALERT
| SCSW_STCTL_STATUS_PEND
);
334 /* Memory problem, generate channel data check. */
335 schib
->scsw
.ctrl
&= ~SCSW_ACTL_START_PEND
;
336 schib
->scsw
.cstat
= SCSW_CSTAT_DATA_CHECK
;
337 schib
->scsw
.ctrl
&= ~SCSW_CTRL_MASK_STCTL
;
338 schib
->scsw
.ctrl
|= SCSW_STCTL_PRIMARY
| SCSW_STCTL_SECONDARY
|
339 SCSW_STCTL_ALERT
| SCSW_STCTL_STATUS_PEND
;
342 /* Error, generate channel program check. */
343 schib
->scsw
.ctrl
&= ~SCSW_ACTL_START_PEND
;
344 schib
->scsw
.cstat
= SCSW_CSTAT_PROG_CHECK
;
345 schib
->scsw
.ctrl
&= ~SCSW_CTRL_MASK_STCTL
;
346 schib
->scsw
.ctrl
|= SCSW_STCTL_PRIMARY
| SCSW_STCTL_SECONDARY
|
347 SCSW_STCTL_ALERT
| SCSW_STCTL_STATUS_PEND
;
350 } else if (size
!= vcdev
->io_region_size
) {
351 /* Information transfer error, generate channel-control check. */
352 schib
->scsw
.ctrl
&= ~SCSW_ACTL_START_PEND
;
353 schib
->scsw
.cstat
= SCSW_CSTAT_CHN_CTRL_CHK
;
354 schib
->scsw
.ctrl
&= ~SCSW_CTRL_MASK_STCTL
;
355 schib
->scsw
.ctrl
|= SCSW_STCTL_PRIMARY
| SCSW_STCTL_SECONDARY
|
356 SCSW_STCTL_ALERT
| SCSW_STCTL_STATUS_PEND
;
360 memcpy(&irb
, region
->irb_area
, sizeof(IRB
));
362 /* Update control block via irb. */
364 copy_scsw_to_guest(&s
, &irb
.scsw
);
367 copy_esw_to_guest(&esw
, &irb
.esw
);
370 /* If a uint check is pending, copy sense data. */
371 if ((schib
->scsw
.dstat
& SCSW_DSTAT_UNIT_CHECK
) &&
372 (schib
->pmcw
.chars
& PMCW_CHARS_MASK_CSENSE
)) {
373 memcpy(sch
->sense_data
, irb
.ecw
, sizeof(irb
.ecw
));
377 css_inject_io_interrupt(sch
);
380 static void vfio_ccw_register_irq_notifier(VFIOCCWDevice
*vcdev
,
384 VFIODevice
*vdev
= &vcdev
->vdev
;
385 struct vfio_irq_info
*irq_info
;
388 EventNotifier
*notifier
;
392 case VFIO_CCW_IO_IRQ_INDEX
:
393 notifier
= &vcdev
->io_notifier
;
394 fd_read
= vfio_ccw_io_notifier_handler
;
396 case VFIO_CCW_CRW_IRQ_INDEX
:
397 notifier
= &vcdev
->crw_notifier
;
398 fd_read
= vfio_ccw_crw_notifier_handler
;
400 case VFIO_CCW_REQ_IRQ_INDEX
:
401 notifier
= &vcdev
->req_notifier
;
402 fd_read
= vfio_ccw_req_notifier_handler
;
405 error_setg(errp
, "vfio: Unsupported device irq(%d)", irq
);
409 if (vdev
->num_irqs
< irq
+ 1) {
410 error_setg(errp
, "vfio: IRQ %u not available (number of irqs %u)",
411 irq
, vdev
->num_irqs
);
415 argsz
= sizeof(*irq_info
);
416 irq_info
= g_malloc0(argsz
);
417 irq_info
->index
= irq
;
418 irq_info
->argsz
= argsz
;
419 if (ioctl(vdev
->fd
, VFIO_DEVICE_GET_IRQ_INFO
,
420 irq_info
) < 0 || irq_info
->count
< 1) {
421 error_setg_errno(errp
, errno
, "vfio: Error getting irq info");
425 if (event_notifier_init(notifier
, 0)) {
426 error_setg_errno(errp
, errno
,
427 "vfio: Unable to init event notifier for irq (%d)",
432 fd
= event_notifier_get_fd(notifier
);
433 qemu_set_fd_handler(fd
, fd_read
, NULL
, vcdev
);
435 if (vfio_set_irq_signaling(vdev
, irq
, 0,
436 VFIO_IRQ_SET_ACTION_TRIGGER
, fd
, errp
)) {
437 qemu_set_fd_handler(fd
, NULL
, NULL
, vcdev
);
438 event_notifier_cleanup(notifier
);
445 static void vfio_ccw_unregister_irq_notifier(VFIOCCWDevice
*vcdev
,
449 EventNotifier
*notifier
;
452 case VFIO_CCW_IO_IRQ_INDEX
:
453 notifier
= &vcdev
->io_notifier
;
455 case VFIO_CCW_CRW_IRQ_INDEX
:
456 notifier
= &vcdev
->crw_notifier
;
458 case VFIO_CCW_REQ_IRQ_INDEX
:
459 notifier
= &vcdev
->req_notifier
;
462 error_report("vfio: Unsupported device irq(%d)", irq
);
466 if (vfio_set_irq_signaling(&vcdev
->vdev
, irq
, 0,
467 VFIO_IRQ_SET_ACTION_TRIGGER
, -1, &err
)) {
468 warn_reportf_err(err
, VFIO_MSG_PREFIX
, vcdev
->vdev
.name
);
471 qemu_set_fd_handler(event_notifier_get_fd(notifier
),
473 event_notifier_cleanup(notifier
);
476 static void vfio_ccw_get_region(VFIOCCWDevice
*vcdev
, Error
**errp
)
478 VFIODevice
*vdev
= &vcdev
->vdev
;
479 struct vfio_region_info
*info
;
482 /* Sanity check device */
483 if (!(vdev
->flags
& VFIO_DEVICE_FLAGS_CCW
)) {
484 error_setg(errp
, "vfio: Um, this isn't a vfio-ccw device");
489 * We always expect at least the I/O region to be present. We also
490 * may have a variable number of regions governed by capabilities.
492 if (vdev
->num_regions
< VFIO_CCW_CONFIG_REGION_INDEX
+ 1) {
493 error_setg(errp
, "vfio: too few regions (%u), expected at least %u",
494 vdev
->num_regions
, VFIO_CCW_CONFIG_REGION_INDEX
+ 1);
498 ret
= vfio_get_region_info(vdev
, VFIO_CCW_CONFIG_REGION_INDEX
, &info
);
500 error_setg_errno(errp
, -ret
, "vfio: Error getting config info");
504 vcdev
->io_region_size
= info
->size
;
505 if (sizeof(*vcdev
->io_region
) != vcdev
->io_region_size
) {
506 error_setg(errp
, "vfio: Unexpected size of the I/O region");
510 vcdev
->io_region_offset
= info
->offset
;
511 vcdev
->io_region
= g_malloc0(info
->size
);
514 /* check for the optional async command region */
515 ret
= vfio_get_dev_region_info(vdev
, VFIO_REGION_TYPE_CCW
,
516 VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD
, &info
);
518 vcdev
->async_cmd_region_size
= info
->size
;
519 if (sizeof(*vcdev
->async_cmd_region
) != vcdev
->async_cmd_region_size
) {
520 error_setg(errp
, "vfio: Unexpected size of the async cmd region");
523 vcdev
->async_cmd_region_offset
= info
->offset
;
524 vcdev
->async_cmd_region
= g_malloc0(info
->size
);
528 ret
= vfio_get_dev_region_info(vdev
, VFIO_REGION_TYPE_CCW
,
529 VFIO_REGION_SUBTYPE_CCW_SCHIB
, &info
);
531 vcdev
->schib_region_size
= info
->size
;
532 if (sizeof(*vcdev
->schib_region
) != vcdev
->schib_region_size
) {
533 error_setg(errp
, "vfio: Unexpected size of the schib region");
536 vcdev
->schib_region_offset
= info
->offset
;
537 vcdev
->schib_region
= g_malloc(info
->size
);
541 ret
= vfio_get_dev_region_info(vdev
, VFIO_REGION_TYPE_CCW
,
542 VFIO_REGION_SUBTYPE_CCW_CRW
, &info
);
545 vcdev
->crw_region_size
= info
->size
;
546 if (sizeof(*vcdev
->crw_region
) != vcdev
->crw_region_size
) {
547 error_setg(errp
, "vfio: Unexpected size of the CRW region");
550 vcdev
->crw_region_offset
= info
->offset
;
551 vcdev
->crw_region
= g_malloc(info
->size
);
558 g_free(vcdev
->crw_region
);
559 g_free(vcdev
->schib_region
);
560 g_free(vcdev
->async_cmd_region
);
561 g_free(vcdev
->io_region
);
566 static void vfio_ccw_put_region(VFIOCCWDevice
*vcdev
)
568 g_free(vcdev
->crw_region
);
569 g_free(vcdev
->schib_region
);
570 g_free(vcdev
->async_cmd_region
);
571 g_free(vcdev
->io_region
);
574 static void vfio_ccw_realize(DeviceState
*dev
, Error
**errp
)
576 S390CCWDevice
*cdev
= S390_CCW_DEVICE(dev
);
577 VFIOCCWDevice
*vcdev
= VFIO_CCW(cdev
);
578 S390CCWDeviceClass
*cdc
= S390_CCW_DEVICE_GET_CLASS(cdev
);
579 VFIODevice
*vbasedev
= &vcdev
->vdev
;
583 /* Call the class init function for subchannel. */
585 cdc
->realize(cdev
, vcdev
->vdev
.sysfsdev
, &err
);
587 goto out_err_propagate
;
591 vbasedev
->ops
= &vfio_ccw_ops
;
592 vbasedev
->type
= VFIO_DEVICE_TYPE_CCW
;
593 vbasedev
->name
= g_strdup_printf("%x.%x.%04x", vcdev
->cdev
.hostid
.cssid
,
594 vcdev
->cdev
.hostid
.ssid
,
595 vcdev
->cdev
.hostid
.devid
);
599 * All vfio-ccw devices are believed to operate in a way compatible with
600 * discarding of memory in RAM blocks, ie. pages pinned in the host are
601 * in the current working set of the guest driver and therefore never
602 * overlap e.g., with pages available to the guest balloon driver. This
603 * needs to be set before vfio_get_device() for vfio common to handle
604 * ram_block_discard_disable().
606 vbasedev
->ram_block_discard_allowed
= true;
608 ret
= vfio_attach_device(cdev
->mdevid
, vbasedev
,
609 &address_space_memory
, errp
);
611 goto out_attach_dev_err
;
614 vfio_ccw_get_region(vcdev
, &err
);
619 vfio_ccw_register_irq_notifier(vcdev
, VFIO_CCW_IO_IRQ_INDEX
, &err
);
621 goto out_io_notifier_err
;
624 if (vcdev
->crw_region
) {
625 vfio_ccw_register_irq_notifier(vcdev
, VFIO_CCW_CRW_IRQ_INDEX
, &err
);
627 goto out_irq_notifier_err
;
631 vfio_ccw_register_irq_notifier(vcdev
, VFIO_CCW_REQ_IRQ_INDEX
, &err
);
634 * Report this error, but do not make it a failing condition.
635 * Lack of this IRQ in the host does not prevent normal operation.
637 error_report_err(err
);
642 out_irq_notifier_err
:
643 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_REQ_IRQ_INDEX
);
644 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_CRW_IRQ_INDEX
);
645 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_IO_IRQ_INDEX
);
647 vfio_ccw_put_region(vcdev
);
649 vfio_detach_device(vbasedev
);
651 g_free(vbasedev
->name
);
652 if (cdc
->unrealize
) {
653 cdc
->unrealize(cdev
);
656 error_propagate(errp
, err
);
659 static void vfio_ccw_unrealize(DeviceState
*dev
)
661 S390CCWDevice
*cdev
= S390_CCW_DEVICE(dev
);
662 VFIOCCWDevice
*vcdev
= VFIO_CCW(cdev
);
663 S390CCWDeviceClass
*cdc
= S390_CCW_DEVICE_GET_CLASS(cdev
);
665 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_REQ_IRQ_INDEX
);
666 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_CRW_IRQ_INDEX
);
667 vfio_ccw_unregister_irq_notifier(vcdev
, VFIO_CCW_IO_IRQ_INDEX
);
668 vfio_ccw_put_region(vcdev
);
669 vfio_detach_device(&vcdev
->vdev
);
670 g_free(vcdev
->vdev
.name
);
672 if (cdc
->unrealize
) {
673 cdc
->unrealize(cdev
);
677 static Property vfio_ccw_properties
[] = {
678 DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice
, vdev
.sysfsdev
),
679 DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice
, force_orb_pfch
, false),
680 DEFINE_PROP_END_OF_LIST(),
683 static const VMStateDescription vfio_ccw_vmstate
= {
688 static void vfio_ccw_class_init(ObjectClass
*klass
, void *data
)
690 DeviceClass
*dc
= DEVICE_CLASS(klass
);
691 S390CCWDeviceClass
*cdc
= S390_CCW_DEVICE_CLASS(klass
);
693 device_class_set_props(dc
, vfio_ccw_properties
);
694 dc
->vmsd
= &vfio_ccw_vmstate
;
695 dc
->desc
= "VFIO-based subchannel assignment";
696 set_bit(DEVICE_CATEGORY_MISC
, dc
->categories
);
697 dc
->realize
= vfio_ccw_realize
;
698 dc
->unrealize
= vfio_ccw_unrealize
;
699 dc
->reset
= vfio_ccw_reset
;
701 cdc
->handle_request
= vfio_ccw_handle_request
;
702 cdc
->handle_halt
= vfio_ccw_handle_halt
;
703 cdc
->handle_clear
= vfio_ccw_handle_clear
;
704 cdc
->handle_store
= vfio_ccw_handle_store
;
707 static const TypeInfo vfio_ccw_info
= {
708 .name
= TYPE_VFIO_CCW
,
709 .parent
= TYPE_S390_CCW
,
710 .instance_size
= sizeof(VFIOCCWDevice
),
711 .class_init
= vfio_ccw_class_init
,
714 static void register_vfio_ccw_type(void)
716 type_register_static(&vfio_ccw_info
);
719 type_init(register_vfio_ccw_type
)