Implement the PAPR (pSeries) virtualized interrupt controller (xics)

PAPR defines an interrupt control architecture which is logically divided
into ICS (Interrupt Control Presentation, each unit is responsible for
presenting interrupts to a particular "interrupt server", i.e. CPU) and
ICS (Interrupt Control Source, each unit responsible for one or more
hardware interrupts as numbered globally across the system).  All PAPR
virtual IO devices expect to deliver interrupts via this mechanism.  In
Linux, this interrupt controller system is handled by the "xics" driver.

On pSeries systems, access to the interrupt controller is virtualized via
hypercalls and RTAS methods.  However, the virtualized interface is very
similar to the underlying interrupt controller hardware, and similar PICs
exist un-virtualized in some other systems.

This patch implements both the ICP and ICS sides of the PAPR interrupt
controller.  For now, only the hypercall virtualized interface is provided,
however it would be relatively straightforward to graft an emulated
register interface onto the underlying interrupt logic if we want to add
a machine with a hardware ICS/ICP system in the future.

There are some limitations in this implementation: it is assumed for now
that only one instance of the ICS exists, although a full xics system can
have several, each responsible for a different group of hardware irqs.
ICP/ICS can handle both level-sensitve (LSI) and message signalled (MSI)
interrupt inputs.  For now, this implementation supports only MSI
interrupts, since that is used by PAPR virtual IO devices.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
5 files changed
tree: 9bf9d4a35459792308fc4566331f5871bff350c0
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. default-configs/
  6. docs/
  7. fpu/
  8. fsdev/
  9. gdb-xml/
  10. hw/
  11. linux-user/
  12. net/
  13. pc-bios/
  14. QMP/
  15. roms/
  16. scripts/
  17. slirp/
  18. sysconfigs/
  19. target-alpha/
  20. target-arm/
  21. target-cris/
  22. target-i386/
  23. target-lm32/
  24. target-m68k/
  25. target-microblaze/
  26. target-mips/
  27. target-ppc/
  28. target-s390x/
  29. target-sh4/
  30. target-sparc/
  31. tcg/
  32. tests/
  33. ui/
  34. .gitignore
  35. .gitmodules
  36. a.out.h
  37. acl.c
  38. acl.h
  39. aes.c
  40. aes.h
  41. aio.c
  42. alpha-dis.c
  43. alpha.ld
  44. arch_init.c
  45. arch_init.h
  46. arm-dis.c
  47. arm-semi.c
  48. arm.ld
  49. async.c
  50. balloon.c
  51. balloon.h
  52. bitmap.c
  53. bitmap.h
  54. bitops.c
  55. bitops.h
  56. block-migration.c
  57. block-migration.h
  58. block.c
  59. block.h
  60. block_int.h
  61. blockdev.c
  62. blockdev.h
  63. bswap.h
  64. bt-host.c
  65. bt-host.h
  66. bt-vhci.c
  67. buffered_file.c
  68. buffered_file.h
  69. cache-utils.c
  70. cache-utils.h
  71. Changelog
  72. check-qdict.c
  73. check-qfloat.c
  74. check-qint.c
  75. check-qjson.c
  76. check-qlist.c
  77. check-qstring.c
  78. cmd.c
  79. cmd.h
  80. CODING_STYLE
  81. compatfd.c
  82. compatfd.h
  83. config.h
  84. configure
  85. console.c
  86. console.h
  87. COPYING
  88. COPYING.LIB
  89. cpu-all.h
  90. cpu-common.h
  91. cpu-defs.h
  92. cpu-exec.c
  93. cpus.c
  94. cpus.h
  95. cris-dis.c
  96. cursor.c
  97. cursor_hidden.xpm
  98. cursor_left_ptr.xpm
  99. cutils.c
  100. def-helper.h
  101. device_tree.c
  102. device_tree.h
  103. dis-asm.h
  104. disas.c
  105. disas.h
  106. dma-helpers.c
  107. dma.h
  108. dyngen-exec.h
  109. elf.h
  110. envlist.c
  111. envlist.h
  112. exec-all.h
  113. exec.c
  114. gdbstub.c
  115. gdbstub.h
  116. gen-icount.h
  117. HACKING
  118. hmp-commands.hx
  119. host-utils.c
  120. host-utils.h
  121. hpet.h
  122. hppa-dis.c
  123. hppa.ld
  124. i386-dis.c
  125. i386.ld
  126. ia64-dis.c
  127. ia64.ld
  128. input.c
  129. iohandler.c
  130. ioport-user.c
  131. ioport.c
  132. ioport.h
  133. iorange.h
  134. iov.c
  135. iov.h
  136. json-lexer.c
  137. json-lexer.h
  138. json-parser.c
  139. json-parser.h
  140. json-streamer.c
  141. json-streamer.h
  142. kvm-all.c
  143. kvm-stub.c
  144. kvm.h
  145. libfdt_env.h
  146. LICENSE
  147. linux-aio.c
  148. m68k-dis.c
  149. m68k-semi.c
  150. m68k.ld
  151. MAINTAINERS
  152. Makefile
  153. Makefile.dis
  154. Makefile.hw
  155. Makefile.objs
  156. Makefile.target
  157. Makefile.user
  158. microblaze-dis.c
  159. migration-exec.c
  160. migration-fd.c
  161. migration-tcp.c
  162. migration-unix.c
  163. migration.c
  164. migration.h
  165. mips-dis.c
  166. mips.ld
  167. module.c
  168. module.h
  169. monitor.c
  170. monitor.h
  171. nbd.c
  172. nbd.h
  173. net-checksum.c
  174. net.c
  175. net.h
  176. notify.c
  177. notify.h
  178. os-posix.c
  179. os-win32.c
  180. osdep.c
  181. osdep.h
  182. oslib-posix.c
  183. oslib-win32.c
  184. path.c
  185. pci-ids.txt
  186. pflib.c
  187. pflib.h
  188. poison.h
  189. posix-aio-compat.c
  190. ppc-dis.c
  191. ppc.ld
  192. ppc64.ld
  193. qbool.c
  194. qbool.h
  195. qdict-test-data.txt
  196. qdict.c
  197. qdict.h
  198. qemu-aio.h
  199. qemu-barrier.h
  200. qemu-char.c
  201. qemu-char.h
  202. qemu-common.h
  203. qemu-config.c
  204. qemu-config.h
  205. qemu-doc.texi
  206. qemu-error.c
  207. qemu-error.h
  208. qemu-img-cmds.hx
  209. qemu-img.c
  210. qemu-img.texi
  211. qemu-io.c
  212. qemu-lock.h
  213. qemu-log.h
  214. qemu-malloc.c
  215. qemu-nbd.c
  216. qemu-nbd.texi
  217. qemu-objects.h
  218. qemu-option.c
  219. qemu-option.h
  220. qemu-options.h
  221. qemu-options.hx
  222. qemu-os-posix.h
  223. qemu-os-win32.h
  224. qemu-queue.h
  225. qemu-sockets.c
  226. qemu-tech.texi
  227. qemu-thread-posix.c
  228. qemu-thread-posix.h
  229. qemu-thread-win32.c
  230. qemu-thread-win32.h
  231. qemu-thread.h
  232. qemu-timer-common.c
  233. qemu-timer.c
  234. qemu-timer.h
  235. qemu-tool.c
  236. qemu-x509.h
  237. qemu.sasl
  238. qemu_socket.h
  239. qerror.c
  240. qerror.h
  241. qfloat.c
  242. qfloat.h
  243. qint.c
  244. qint.h
  245. qjson.c
  246. qjson.h
  247. qlist.c
  248. qlist.h
  249. qmp-commands.hx
  250. qobject.h
  251. qstring.c
  252. qstring.h
  253. range.h
  254. readline.c
  255. readline.h
  256. README
  257. rules.mak
  258. rwhandler.c
  259. rwhandler.h
  260. s390-dis.c
  261. s390.ld
  262. savevm.c
  263. sh4-dis.c
  264. simpletrace.c
  265. simpletrace.h
  266. softmmu-semi.h
  267. softmmu_defs.h
  268. softmmu_exec.h
  269. softmmu_header.h
  270. softmmu_template.h
  271. sparc-dis.c
  272. sparc.ld
  273. sparc64.ld
  274. spice-qemu-char.c
  275. sysemu.h
  276. targphys.h
  277. tcg-runtime.c
  278. thunk.c
  279. thunk.h
  280. TODO
  281. trace-events
  282. translate-all.c
  283. uboot_image.h
  284. usb-bsd.c
  285. usb-linux.c
  286. usb-stub.c
  287. VERSION
  288. version.rc
  289. vgafont.h
  290. vl.c
  291. x86_64.ld