s390_flic.txt 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. FLIC (floating interrupt controller)
  2. ====================================
  3. FLIC handles floating (non per-cpu) interrupts, i.e. I/O, service and some
  4. machine check interruptions. All interrupts are stored in a per-vm list of
  5. pending interrupts. FLIC performs operations on this list.
  6. Only one FLIC instance may be instantiated.
  7. FLIC provides support to
  8. - add interrupts (KVM_DEV_FLIC_ENQUEUE)
  9. - inspect currently pending interrupts (KVM_FLIC_GET_ALL_IRQS)
  10. - purge all pending floating interrupts (KVM_DEV_FLIC_CLEAR_IRQS)
  11. - enable/disable for the guest transparent async page faults
  12. - register and modify adapter interrupt sources (KVM_DEV_FLIC_ADAPTER_*)
  13. Groups:
  14. KVM_DEV_FLIC_ENQUEUE
  15. Passes a buffer and length into the kernel which are then injected into
  16. the list of pending interrupts.
  17. attr->addr contains the pointer to the buffer and attr->attr contains
  18. the length of the buffer.
  19. The format of the data structure kvm_s390_irq as it is copied from userspace
  20. is defined in usr/include/linux/kvm.h.
  21. KVM_DEV_FLIC_GET_ALL_IRQS
  22. Copies all floating interrupts into a buffer provided by userspace.
  23. When the buffer is too small it returns -ENOMEM, which is the indication
  24. for userspace to try again with a bigger buffer.
  25. -ENOBUFS is returned when the allocation of a kernelspace buffer has
  26. failed.
  27. -EFAULT is returned when copying data to userspace failed.
  28. All interrupts remain pending, i.e. are not deleted from the list of
  29. currently pending interrupts.
  30. attr->addr contains the userspace address of the buffer into which all
  31. interrupt data will be copied.
  32. attr->attr contains the size of the buffer in bytes.
  33. KVM_DEV_FLIC_CLEAR_IRQS
  34. Simply deletes all elements from the list of currently pending floating
  35. interrupts. No interrupts are injected into the guest.
  36. KVM_DEV_FLIC_APF_ENABLE
  37. Enables async page faults for the guest. So in case of a major page fault
  38. the host is allowed to handle this async and continues the guest.
  39. KVM_DEV_FLIC_APF_DISABLE_WAIT
  40. Disables async page faults for the guest and waits until already pending
  41. async page faults are done. This is necessary to trigger a completion interrupt
  42. for every init interrupt before migrating the interrupt list.
  43. KVM_DEV_FLIC_ADAPTER_REGISTER
  44. Register an I/O adapter interrupt source. Takes a kvm_s390_io_adapter
  45. describing the adapter to register:
  46. struct kvm_s390_io_adapter {
  47. __u32 id;
  48. __u8 isc;
  49. __u8 maskable;
  50. __u8 swap;
  51. __u8 pad;
  52. };
  53. id contains the unique id for the adapter, isc the I/O interruption subclass
  54. to use, maskable whether this adapter may be masked (interrupts turned off)
  55. and swap whether the indicators need to be byte swapped.
  56. KVM_DEV_FLIC_ADAPTER_MODIFY
  57. Modifies attributes of an existing I/O adapter interrupt source. Takes
  58. a kvm_s390_io_adapter_req specifiying the adapter and the operation:
  59. struct kvm_s390_io_adapter_req {
  60. __u32 id;
  61. __u8 type;
  62. __u8 mask;
  63. __u16 pad0;
  64. __u64 addr;
  65. };
  66. id specifies the adapter and type the operation. The supported operations
  67. are:
  68. KVM_S390_IO_ADAPTER_MASK
  69. mask or unmask the adapter, as specified in mask
  70. KVM_S390_IO_ADAPTER_MAP
  71. perform a gmap translation for the guest address provided in addr,
  72. pin a userspace page for the translated address and add it to the
  73. list of mappings
  74. KVM_S390_IO_ADAPTER_UNMAP
  75. release a userspace page for the translated address specified in addr
  76. from the list of mappings