1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * definition for virtio for kvm on s390
5 * Copyright IBM Corp. 2008
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License (version 2 only)
9 * as published by the Free Software Foundation.
11 * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
14 #ifndef __KVM_S390_VIRTIO_H
15 #define __KVM_S390_VIRTIO_H
17 #include <linux/types.h>
19 struct kvm_device_desc {
20 /* The device type: console, network, disk etc. Type 0 terminates. */
22 /* The number of virtqueues (first in config array) */
25 * The number of bytes of feature bits. Multiply by 2: one for host
26 * features and one for guest acknowledgements.
29 /* The number of bytes of the config array after virtqueues. */
31 /* A status byte, written by the Guest. */
37 * This is how we expect the device configuration field for a virtqueue
38 * to be laid out in config space.
41 /* The token returned with an interrupt. Set by the guest */
43 /* The address of the virtio ring */
45 /* The number of entries in the virtio_ring */
50 #define KVM_S390_VIRTIO_NOTIFY 0
51 #define KVM_S390_VIRTIO_RESET 1
52 #define KVM_S390_VIRTIO_SET_STATUS 2
54 /* The alignment to use between consumer and producer parts of vring.
55 * This is pagesize for historical reasons. */
56 #define KVM_S390_VIRTIO_RING_ALIGN 4096
59 /* These values are supposed to be in ext_params on an interrupt */
60 #define VIRTIO_PARAM_MASK 0xff
61 #define VIRTIO_PARAM_VRING_INTERRUPT 0x0
62 #define VIRTIO_PARAM_CONFIG_CHANGED 0x1
63 #define VIRTIO_PARAM_DEV_ADD 0x2