target/sparc: Make sparc_cpu_tlb_fill sysemu only
[qemu.git] / hw / s390x / virtio-ccw.h
blob0168232e3b8db1da2a91dfd157db74740b99c9e6
1 /*
2 * virtio ccw target definitions
4 * Copyright 2012,2015 IBM Corp.
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 * Pierre Morel <pmorel@linux.vnet.ibm.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at
9 * your option) any later version. See the COPYING file in the top-level
10 * directory.
13 #ifndef HW_S390X_VIRTIO_CCW_H
14 #define HW_S390X_VIRTIO_CCW_H
16 #include "hw/virtio/virtio-blk.h"
17 #include "hw/virtio/virtio-net.h"
18 #include "hw/virtio/virtio-serial.h"
19 #include "hw/virtio/virtio-scsi.h"
20 #include "qom/object.h"
21 #ifdef CONFIG_VHOST_SCSI
22 #include "hw/virtio/vhost-scsi.h"
23 #endif
24 #include "hw/virtio/virtio-balloon.h"
25 #include "hw/virtio/virtio-rng.h"
26 #include "hw/virtio/virtio-crypto.h"
27 #include "hw/virtio/virtio-bus.h"
28 #ifdef CONFIG_VHOST_VSOCK
29 #include "hw/virtio/vhost-vsock.h"
30 #endif /* CONFIG_VHOST_VSOCK */
31 #include "hw/virtio/virtio-gpu.h"
32 #include "hw/virtio/virtio-input.h"
34 #include "hw/s390x/s390_flic.h"
35 #include "hw/s390x/css.h"
36 #include "ccw-device.h"
37 #include "hw/s390x/css-bridge.h"
39 #define VIRTIO_CCW_CU_TYPE 0x3832
40 #define VIRTIO_CCW_CHPID_TYPE 0x32
42 #define CCW_CMD_SET_VQ 0x13
43 #define CCW_CMD_VDEV_RESET 0x33
44 #define CCW_CMD_READ_FEAT 0x12
45 #define CCW_CMD_WRITE_FEAT 0x11
46 #define CCW_CMD_READ_CONF 0x22
47 #define CCW_CMD_WRITE_CONF 0x21
48 #define CCW_CMD_WRITE_STATUS 0x31
49 #define CCW_CMD_SET_IND 0x43
50 #define CCW_CMD_SET_CONF_IND 0x53
51 #define CCW_CMD_READ_VQ_CONF 0x32
52 #define CCW_CMD_READ_STATUS 0x72
53 #define CCW_CMD_SET_IND_ADAPTER 0x73
54 #define CCW_CMD_SET_VIRTIO_REV 0x83
56 #define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device"
57 OBJECT_DECLARE_TYPE(VirtioCcwDevice, VirtIOCCWDeviceClass, VIRTIO_CCW_DEVICE)
59 typedef struct VirtioBusState VirtioCcwBusState;
60 typedef struct VirtioBusClass VirtioCcwBusClass;
62 #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
63 DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass,
64 VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS)
67 * modules can reference this symbol to avoid being loaded
68 * into system emulators without ccw support
70 extern bool have_virtio_ccw;
72 struct VirtIOCCWDeviceClass {
73 CCWDeviceClass parent_class;
74 void (*realize)(VirtioCcwDevice *dev, Error **errp);
75 void (*unrealize)(VirtioCcwDevice *dev);
76 void (*parent_reset)(DeviceState *dev);
79 /* Performance improves when virtqueue kick processing is decoupled from the
80 * vcpu thread using ioeventfd for some devices. */
81 #define VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT 1
82 #define VIRTIO_CCW_FLAG_USE_IOEVENTFD (1 << VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT)
84 struct VirtioCcwDevice {
85 CcwDevice parent_obj;
86 int revision;
87 uint32_t max_rev;
88 VirtioBusState bus;
89 uint32_t flags;
90 uint8_t thinint_isc;
91 AdapterRoutes routes;
92 /* Guest provided values: */
93 IndAddr *indicators;
94 IndAddr *indicators2;
95 IndAddr *summary_indicator;
96 uint64_t ind_bit;
97 bool force_revision_1;
100 /* The maximum virtio revision we support. */
101 #define VIRTIO_CCW_MAX_REV 2
102 static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
104 return dev->max_rev;
107 /* virtio-scsi-ccw */
109 #define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw"
110 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOSCSICcw, VIRTIO_SCSI_CCW)
112 struct VirtIOSCSICcw {
113 VirtioCcwDevice parent_obj;
114 VirtIOSCSI vdev;
117 #ifdef CONFIG_VHOST_SCSI
118 /* vhost-scsi-ccw */
120 #define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw"
121 OBJECT_DECLARE_SIMPLE_TYPE(VHostSCSICcw, VHOST_SCSI_CCW)
123 struct VHostSCSICcw {
124 VirtioCcwDevice parent_obj;
125 VHostSCSI vdev;
127 #endif
129 /* virtio-blk-ccw */
131 #define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw"
132 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBlkCcw, VIRTIO_BLK_CCW)
134 struct VirtIOBlkCcw {
135 VirtioCcwDevice parent_obj;
136 VirtIOBlock vdev;
139 /* virtio-balloon-ccw */
141 #define TYPE_VIRTIO_BALLOON_CCW "virtio-balloon-ccw"
142 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBalloonCcw, VIRTIO_BALLOON_CCW)
144 struct VirtIOBalloonCcw {
145 VirtioCcwDevice parent_obj;
146 VirtIOBalloon vdev;
149 /* virtio-serial-ccw */
151 #define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw"
152 OBJECT_DECLARE_SIMPLE_TYPE(VirtioSerialCcw, VIRTIO_SERIAL_CCW)
154 struct VirtioSerialCcw {
155 VirtioCcwDevice parent_obj;
156 VirtIOSerial vdev;
159 /* virtio-net-ccw */
161 #define TYPE_VIRTIO_NET_CCW "virtio-net-ccw"
162 OBJECT_DECLARE_SIMPLE_TYPE(VirtIONetCcw, VIRTIO_NET_CCW)
164 struct VirtIONetCcw {
165 VirtioCcwDevice parent_obj;
166 VirtIONet vdev;
169 /* virtio-rng-ccw */
171 #define TYPE_VIRTIO_RNG_CCW "virtio-rng-ccw"
172 OBJECT_DECLARE_SIMPLE_TYPE(VirtIORNGCcw, VIRTIO_RNG_CCW)
174 struct VirtIORNGCcw {
175 VirtioCcwDevice parent_obj;
176 VirtIORNG vdev;
179 /* virtio-crypto-ccw */
181 #define TYPE_VIRTIO_CRYPTO_CCW "virtio-crypto-ccw"
182 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOCryptoCcw, VIRTIO_CRYPTO_CCW)
184 struct VirtIOCryptoCcw {
185 VirtioCcwDevice parent_obj;
186 VirtIOCrypto vdev;
189 VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
191 #ifdef CONFIG_VIRTFS
192 #include "hw/9pfs/virtio-9p.h"
194 #define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw"
195 OBJECT_DECLARE_SIMPLE_TYPE(V9fsCCWState, VIRTIO_9P_CCW)
197 struct V9fsCCWState {
198 VirtioCcwDevice parent_obj;
199 V9fsVirtioState vdev;
202 #endif /* CONFIG_VIRTFS */
204 #ifdef CONFIG_VHOST_VSOCK
205 #define TYPE_VHOST_VSOCK_CCW "vhost-vsock-ccw"
206 OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCCWState, VHOST_VSOCK_CCW)
208 struct VHostVSockCCWState {
209 VirtioCcwDevice parent_obj;
210 VHostVSock vdev;
213 #endif /* CONFIG_VHOST_VSOCK */
215 #define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw"
216 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUCcw, VIRTIO_GPU_CCW)
218 struct VirtIOGPUCcw {
219 VirtioCcwDevice parent_obj;
220 VirtIOGPU vdev;
223 #define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw"
224 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputCcw, VIRTIO_INPUT_CCW)
226 struct VirtIOInputCcw {
227 VirtioCcwDevice parent_obj;
228 VirtIOInput vdev;
231 #define TYPE_VIRTIO_INPUT_HID_CCW "virtio-input-hid-ccw"
232 #define TYPE_VIRTIO_KEYBOARD_CCW "virtio-keyboard-ccw"
233 #define TYPE_VIRTIO_MOUSE_CCW "virtio-mouse-ccw"
234 #define TYPE_VIRTIO_TABLET_CCW "virtio-tablet-ccw"
235 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOInputHIDCcw, VIRTIO_INPUT_HID_CCW)
237 struct VirtIOInputHIDCcw {
238 VirtioCcwDevice parent_obj;
239 VirtIOInputHID vdev;
242 #endif