um: Support dynamic IRQ allocation
authorJohannes Berg <johannes.berg@intel.com>
Wed, 2 Dec 2020 11:59:50 +0000 (12:59 +0100)
committerRichard Weinberger <richard@nod.at>
Sun, 13 Dec 2020 21:22:08 +0000 (22:22 +0100)
commit36d46a5907ba170965307c9d106cc35517acbf33
tree35b1748a7ab1981f00903874a34d68b9977aee60
parentd66c91836b8d7df3b6f0fe7f0c7617d28ebfcb4c
um: Support dynamic IRQ allocation

It's cumbersome and error-prone to keep adding fixed IRQ numbers,
and for proper device wakeup support for the virtio/vhost-user
support we need to have different IRQs for each device. Even if
in theory two IRQs (with and without wake) might be sufficient,
it's much easier to reason about it when we have dynamic number
assignment. It also makes it easier to add new devices that may
dynamically exist or depending on the configuration, etc.

Add support for this, up to 64 IRQs (the same limit as epoll FDs
we have right now). Since it's not easy to port all the existing
places to dynamic allocation (some data is statically initialized)
keep the low numbers are reserved for the existing hard-coded IRQ
numbers.

Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
13 files changed:
arch/um/drivers/line.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/net_kern.c
arch/um/drivers/port_kern.c
arch/um/drivers/random.c
arch/um/drivers/ubd_kern.c
arch/um/drivers/vector_kern.c
arch/um/drivers/virtio_uml.c
arch/um/drivers/xterm_kern.c
arch/um/include/asm/irq.h
arch/um/include/shared/irq_kern.h
arch/um/kernel/irq.c
arch/um/kernel/sigio.c