kvm_virtio.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * kvm_virtio.h - definition for virtio for kvm on s390
  3. *
  4. * Copyright IBM Corp. 2008
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License (version 2 only)
  8. * as published by the Free Software Foundation.
  9. *
  10. * Author(s): Christian Borntraeger <borntraeger@de.ibm.com>
  11. */
  12. #ifndef __KVM_S390_VIRTIO_H
  13. #define __KVM_S390_VIRTIO_H
  14. #include <linux/types.h>
  15. struct kvm_device_desc {
  16. /* The device type: console, network, disk etc. Type 0 terminates. */
  17. __u8 type;
  18. /* The number of virtqueues (first in config array) */
  19. __u8 num_vq;
  20. /*
  21. * The number of bytes of feature bits. Multiply by 2: one for host
  22. * features and one for guest acknowledgements.
  23. */
  24. __u8 feature_len;
  25. /* The number of bytes of the config array after virtqueues. */
  26. __u8 config_len;
  27. /* A status byte, written by the Guest. */
  28. __u8 status;
  29. __u8 config[0];
  30. };
  31. /*
  32. * This is how we expect the device configuration field for a virtqueue
  33. * to be laid out in config space.
  34. */
  35. struct kvm_vqconfig {
  36. /* The token returned with an interrupt. Set by the guest */
  37. __u64 token;
  38. /* The address of the virtio ring */
  39. __u64 address;
  40. /* The number of entries in the virtio_ring */
  41. __u16 num;
  42. };
  43. #define KVM_S390_VIRTIO_NOTIFY 0
  44. #define KVM_S390_VIRTIO_RESET 1
  45. #define KVM_S390_VIRTIO_SET_STATUS 2
  46. /* The alignment to use between consumer and producer parts of vring.
  47. * This is pagesize for historical reasons. */
  48. #define KVM_S390_VIRTIO_RING_ALIGN 4096
  49. /* These values are supposed to be in ext_params on an interrupt */
  50. #define VIRTIO_PARAM_MASK 0xff
  51. #define VIRTIO_PARAM_VRING_INTERRUPT 0x0
  52. #define VIRTIO_PARAM_CONFIG_CHANGED 0x1
  53. #define VIRTIO_PARAM_DEV_ADD 0x2
  54. #endif