Cc: Thomas Gleixner <tglx@...>, Linux Kernel Mailing List <linux-kernel@...>, Andi Kleen <andi@...>, Avi Kivity <avi@...>, H. Peter Anvin <hpa@...>, Eric W. Biederman <ebiederm@...>
hm, in theory the highest quality method would be to do this on the
genirq level and register your own special "Xen irq-chip" methods. [see
include/linux/irq.h's "struct irq_chip" and kernel/irq/*.c]
you can use set_irq_chip() to claim a specific irq and set up its
handling at the highest level. That way you dont have to do anything in
the x86 hw vector space at all and you'd avoid all the overhead and
complications of x86 irq vectors. You can control how these interrupts
are named in /proc/interrupts, etc.
but this needs synchronization with all the other entities that claim
specific irqs and expect to be able to get them. MSI already does that
to a certain level, see arch_setup_msi_irq() / set_irq_msi(). But that
wastes x86 vectors and we dont really want to waste them as you dont
actually want to use any separate per irq hw vectoring mechanism for
these interrupts.
So the most intelligent method would be to reserve the Linux irq itself
but not the vector, i.e. allocate from irq_cfg[] in
arch/x86/kernel/io_apic_64.c so that the irq number does not get reused
- setting irq_cfg[irq].vector to -1 will achieve that.
Ingo
--