[PATCH] x86: increase interrupt vector range
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 27 Jun 2006 09:53:44 +0000 (02:53 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 28 Jun 2006 00:32:37 +0000 (17:32 -0700)
Remove the limit of 256 interrupt vectors by changing the value stored in
orig_{e,r}ax to be the complemented 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_IRQS can
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.

Signed-off-by: Ian Pratt <ian.pratt@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/entry.S
arch/i386/kernel/irq.c
arch/x86_64/kernel/entry.S
arch/x86_64/kernel/irq.c
arch/x86_64/kernel/smp.c
include/asm-x86_64/hw_irq.h

index e6e4506e749acbe079f9196fab1a05a6e333a753..8713e0248a0be1d9902b1d813680b20528d46df9 100644 (file)
@@ -515,7 +515,7 @@ ENTRY(irq_entries_start)
  .if vector
        CFI_ADJUST_CFA_OFFSET -4
  .endif
-1:     pushl $vector-256
+1:     pushl $~(vector)
        CFI_ADJUST_CFA_OFFSET 4
        jmp common_interrupt
 .data
@@ -535,7 +535,7 @@ common_interrupt:
 #define BUILD_INTERRUPT(name, nr)      \
 ENTRY(name)                            \
        RING0_INT_FRAME;                \
-       pushl $nr-256;                  \
+       pushl $~(nr);                   \
        CFI_ADJUST_CFA_OFFSET 4;        \
        SAVE_ALL;                       \
        movl %esp,%eax;                 \
index 061533e0cb5e8efa284258c3619665a287a786e5..586b15f6741f21642143d3ad63ed392db9e51135 100644 (file)
@@ -53,8 +53,8 @@ static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
  */
 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;
index 7290e72b9a34d2a56be1a90e3c96989d9df1d844..22cac4487b57fd1e9aef98769071a8e4f02f0d81 100644 (file)
@@ -588,7 +588,7 @@ END(common_interrupt)
  */            
        .macro apicinterrupt num,func
        INTR_FRAME
-       pushq $\num-256
+       pushq $~(\num)
        CFI_ADJUST_CFA_OFFSET 8
        interrupt \func
        jmp ret_from_intr
index 59518d4d43589a9b99724ecefbd6b6162b43ac28..3be0a7e4bf08d1b0109c946d1470e0c0292bc214 100644 (file)
@@ -115,8 +115,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();
index acee4bc3f6fa945799d194b17cfbf4cac20285e6..5a1c0a3bf87262c027c327773628e93e58194188 100644 (file)
@@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs)
 
        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))
index 1b2ac55d3204e9ed6bbf3816fd82c50fa774f461..931877462788473f71d39b04198dfa56986d79eb 100644 (file)
@@ -124,7 +124,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)