Increase x86 interrupt vector range
In-Reply-To: <[email protected]>
Quoted 6 lines · Chris Wright
Remove the limit of 256 interrupt vectors by changing the value stored in orig_{e,r}ax to be the negated interrupt vector. The orig_{e,r}ax needs to be < 0 to allow the signal code to distinguish between return from interrupt and return from syscall. With this change applied,
NR_IRQScan be > 256.
Quoted 8 lines
Xen extends the IRQ numbering space to include room for dynamically allocated virtual interrupts (in the range 256-511), which requires a more permissive interface to
do_IRQ.Signed-off-by Ian Pratt <[email protected]>Signed-off-by Christian Limpach <[email protected]>Signed-off-by Chris Wright <[email protected]>---
AFAIC this could go in anytime. It's simple, self-contained and makes sense even without Xen.
One minor nit: the IRQ value isn't negated, it's complemented. The comments need to be fixed.
Original patch:
arch/i386/kernel/entry.S | 4 ++-- arch/i386/kernel/irq.c | 4 ++-- arch/x86_64/kernel/entry.S | 2 +- arch/x86_64/kernel/irq.c | 4 ++-- arch/x86_64/kernel/smp.c | 4 ++-- include/asm-x86_64/hw_irq.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
arch/i386/kernel/entry.S +2 -2
@@ -464,7 +464,7 @@ vector=0 ENTRY(irq_entries_start) .rept NR_IRQS ALIGN -1: pushl $vector-256 +1: pushl $~(vector) jmp common_interrupt .data .long 1b
@@ -481,7 +481,7 @@ common_interrupt: #define BUILD_INTERRUPT(name, nr) \ ENTRY(name) \ - pushl $nr-256; \ + pushl $~(nr); \ SAVE_ALL \ movl %esp,%eax; \ call smp_/**/name; \
arch/i386/kernel/irq.c +2 -2
@@ -53,8 +53,8 @@ static union irq_ctx *softirq_ctx[NR_CPU*/ fastcall unsigned int do_IRQ(struct pt_regs *regs) { -/* high bits used in ret_from_ code */ -int irq = regs->orig_eax &0xff ; +/* high bit used in ret_from_ code */ +int irq = ~regs->orig_eax;#ifdef CONFIG_4KSTACKS union irq_ctx *curctx, *irqctx;u32 *isp;
arch/x86_64/kernel/entry.S +1 -1
@@ -601,7 +601,7 @@ retint_kernel: */ .macro apicinterrupt num,func INTR_FRAME - pushq $\num-256 + pushq $~(\num) CFI_ADJUST_CFA_OFFSET 8 interrupt \func jmp ret_from_intr
arch/x86_64/kernel/irq.c +2 -2
@@ -91,8 +91,8 @@ skip:*/ asmlinkage unsigned int do_IRQ(struct pt_regs *regs) { -/* high bits used in ret_from_ code */ -unsigned irq = regs->orig_rax &0xff ; +/* high bit used in ret_from_ code */ +unsigned irq = ~regs->orig_rax;exit_idle ();irq_enter ();
arch/x86_64/kernel/smp.c +2 -2
@@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt cpu =smp_processor_id ();/* -* orig_rax contains the interrupt vector - 256. +* orig_rax contains the negated interrupt vector. * Use that to determine where the sender put the data. */ - sender = regs->orig_rax +256 -INVALIDATE_TLB_VECTOR_START ; + sender = ~regs->orig_rax -INVALIDATE_TLB_VECTOR_START ; f = &per_cpu (flush_state, sender);if (!cpu_isset (cpu, f->flush_cpumask))
include/asm-x86_64/hw_irq.h +1 -1
@@ -127,7 +127,7 @@ asmlinkage void IRQ_NAME(nr); \ __asm__( \ "\n.p2align\n" \ "IRQ" #nr "_interrupt:\n\t" \ - "push $" #nr "-256 ; " \ + "push $~(" #nr ") ; " \ "jmp common_interrupt");#if defined(CONFIG_X86_IO_APIC )
Signature · 4 lines
Chuck
"The x86 isn't all that complex -- it just doesn't make a lot of sense."
-- Mike JohnsonQuoted 5 lines · Chuck Ebbert
AFAIC this could go in anytime. It's simple, self-contained and makes sense even without Xen.
One minor nit: the IRQ value isn't negated, it's complemented. The comments need to be fixed.
If we really want it disambiguated then we should call it something like 'bitwise-negated' or 'ones-complemented'. 'Complemented' alone is worse than 'negated' imo, since negation is at least the usual name for the tilde operator in C while complementation is an ambiguous term unless you know the base/radix.
-- Keir
Quoted 5 lines · Keir Fraser
If we really want it disambiguated then we should call it something like 'bitwise-negated' or 'ones-complemented'. 'Complemented' alone is worse than 'negated' imo, since negation is at least the usual name for the tilde operator in C while complementation is an ambiguous term unless you know the base/radix.
Not really.
I've seen "negate" only be used to mean "twos complement" and "invert" only be seen with "ones complement".
So if you like to be clear, just use "negate" vs. "invert".
Regards
Ingo Oeser
Quoted 14 lines · * Chuck Ebbert ([email protected]) wrote:
In-Reply-To: <[email protected]>
Quoted 10 lines · Chris Wright
Remove the limit of 256 interrupt vectors by changing the value stored in orig_{e,r}ax to be the negated interrupt vector. The orig_{e,r}ax needs to be < 0 to allow the signal code to distinguish between return from interrupt and return from syscall. With this change applied,
NR_IRQScan be > 256.Xen extends the IRQ numbering space to include room for dynamically allocated virtual interrupts (in the range 256-511), which requires a more permissive interface to
do_IRQ.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Ian Pratt <[email protected]>Signed-off-by Christian Limpach <[email protected]>Signed-off-by Chris Wright <[email protected]>---
AFAIC this could go in anytime. It's simple, self-contained and makes sense even without Xen.
The plan is to split out things like this and push them ahead of the rest of the batch.
Quoted 2 lines
One minor nit: the IRQ value isn't negated, it's complemented. The comments need to be fixed.
OK, bitwise negated.
thanks,
-chris