xics.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. XICS interrupt controller
  2. Device type supported: KVM_DEV_TYPE_XICS
  3. Groups:
  4. KVM_DEV_XICS_SOURCES
  5. Attributes: One per interrupt source, indexed by the source number.
  6. This device emulates the XICS (eXternal Interrupt Controller
  7. Specification) defined in PAPR. The XICS has a set of interrupt
  8. sources, each identified by a 20-bit source number, and a set of
  9. Interrupt Control Presentation (ICP) entities, also called "servers",
  10. each associated with a virtual CPU.
  11. The ICP entities are created by enabling the KVM_CAP_IRQ_ARCH
  12. capability for each vcpu, specifying KVM_CAP_IRQ_XICS in args[0] and
  13. the interrupt server number (i.e. the vcpu number from the XICS's
  14. point of view) in args[1] of the kvm_enable_cap struct. Each ICP has
  15. 64 bits of state which can be read and written using the
  16. KVM_GET_ONE_REG and KVM_SET_ONE_REG ioctls on the vcpu. The 64 bit
  17. state word has the following bitfields, starting at the
  18. least-significant end of the word:
  19. * Unused, 16 bits
  20. * Pending interrupt priority, 8 bits
  21. Zero is the highest priority, 255 means no interrupt is pending.
  22. * Pending IPI (inter-processor interrupt) priority, 8 bits
  23. Zero is the highest priority, 255 means no IPI is pending.
  24. * Pending interrupt source number, 24 bits
  25. Zero means no interrupt pending, 2 means an IPI is pending
  26. * Current processor priority, 8 bits
  27. Zero is the highest priority, meaning no interrupts can be
  28. delivered, and 255 is the lowest priority.
  29. Each source has 64 bits of state that can be read and written using
  30. the KVM_GET_DEVICE_ATTR and KVM_SET_DEVICE_ATTR ioctls, specifying the
  31. KVM_DEV_XICS_SOURCES attribute group, with the attribute number being
  32. the interrupt source number. The 64 bit state word has the following
  33. bitfields, starting from the least-significant end of the word:
  34. * Destination (server number), 32 bits
  35. This specifies where the interrupt should be sent, and is the
  36. interrupt server number specified for the destination vcpu.
  37. * Priority, 8 bits
  38. This is the priority specified for this interrupt source, where 0 is
  39. the highest priority and 255 is the lowest. An interrupt with a
  40. priority of 255 will never be delivered.
  41. * Level sensitive flag, 1 bit
  42. This bit is 1 for a level-sensitive interrupt source, or 0 for
  43. edge-sensitive (or MSI).
  44. * Masked flag, 1 bit
  45. This bit is set to 1 if the interrupt is masked (cannot be delivered
  46. regardless of its priority), for example by the ibm,int-off RTAS
  47. call, or 0 if it is not masked.
  48. * Pending flag, 1 bit
  49. This bit is 1 if the source has a pending interrupt, otherwise 0.
  50. Only one XICS instance may be created per VM.