ia64/xen-unstable

view patches/linux-2.6.16/x86-increase-interrupt-vector-range.patch @ 9555:d76a7a40f3a9

Fix do_IRQ high bit masking.
Instead of setting the highest bit (which isn't easily done on native x86_64),
negate the interrupt vector stored in orig_{e,r}ax.
Also add patch for native build.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Mar 31 17:44:26 2006 +0100 (2006-03-31)
parents
children
line source
1 Subject: Increase x86 interrupt vector range
3 Remove the limit of 256 interrupt vectors by changing the value
4 stored in orig_{e,r}ax to be the negated interrupt vector.
5 The orig_{e,r}ax needs to be < 0 to allow the signal code to
6 distinguish between return from interrupt and return from syscall.
7 With this change applied, NR_IRQS can be > 256.
9 Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
10 ---
11 arch/i386/kernel/entry.S | 4 ++--
12 arch/i386/kernel/irq.c | 4 ++--
13 arch/x86_64/kernel/entry.S | 2 +-
14 arch/x86_64/kernel/irq.c | 4 ++--
15 arch/x86_64/kernel/smp.c | 4 ++--
16 include/asm-x86_64/hw_irq.h | 2 +-
17 6 files changed, 10 insertions(+), 10 deletions(-)
19 diff -r 7d239c83edea arch/i386/kernel/entry.S
20 --- a/arch/i386/kernel/entry.S Mon Mar 20 06:00:20 2006 +0000
21 +++ b/arch/i386/kernel/entry.S Fri Mar 31 17:01:35 2006 +0100
22 @@ -406,7 +406,7 @@ ENTRY(irq_entries_start)
23 ENTRY(irq_entries_start)
24 .rept NR_IRQS
25 ALIGN
26 -1: pushl $vector-256
27 +1: pushl $~(vector)
28 jmp common_interrupt
29 .data
30 .long 1b
31 @@ -423,7 +423,7 @@ common_interrupt:
33 #define BUILD_INTERRUPT(name, nr) \
34 ENTRY(name) \
35 - pushl $nr-256; \
36 + pushl $~(nr); \
37 SAVE_ALL \
38 movl %esp,%eax; \
39 call smp_/**/name; \
40 diff -r 7d239c83edea arch/i386/kernel/irq.c
41 --- a/arch/i386/kernel/irq.c Mon Mar 20 06:00:20 2006 +0000
42 +++ b/arch/i386/kernel/irq.c Fri Mar 31 17:01:35 2006 +0100
43 @@ -53,8 +53,8 @@ static union irq_ctx *softirq_ctx[NR_CPU
44 */
45 fastcall unsigned int do_IRQ(struct pt_regs *regs)
46 {
47 - /* high bits used in ret_from_ code */
48 - int irq = regs->orig_eax & 0xff;
49 + /* high bit used in ret_from_ code */
50 + int irq = ~regs->orig_eax;
51 #ifdef CONFIG_4KSTACKS
52 union irq_ctx *curctx, *irqctx;
53 u32 *isp;
54 diff -r 7d239c83edea arch/x86_64/kernel/entry.S
55 --- a/arch/x86_64/kernel/entry.S Mon Mar 20 06:00:20 2006 +0000
56 +++ b/arch/x86_64/kernel/entry.S Fri Mar 31 17:01:35 2006 +0100
57 @@ -609,7 +609,7 @@ retint_kernel:
58 */
59 .macro apicinterrupt num,func
60 INTR_FRAME
61 - pushq $\num-256
62 + pushq $~(\num)
63 CFI_ADJUST_CFA_OFFSET 8
64 interrupt \func
65 jmp ret_from_intr
66 diff -r 7d239c83edea arch/x86_64/kernel/irq.c
67 --- a/arch/x86_64/kernel/irq.c Mon Mar 20 06:00:20 2006 +0000
68 +++ b/arch/x86_64/kernel/irq.c Fri Mar 31 17:01:35 2006 +0100
69 @@ -96,8 +96,8 @@ skip:
70 */
71 asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
72 {
73 - /* high bits used in ret_from_ code */
74 - unsigned irq = regs->orig_rax & 0xff;
75 + /* high bit used in ret_from_ code */
76 + unsigned irq = ~regs->orig_rax;
78 exit_idle();
79 irq_enter();
80 diff -r 7d239c83edea arch/x86_64/kernel/smp.c
81 --- a/arch/x86_64/kernel/smp.c Mon Mar 20 06:00:20 2006 +0000
82 +++ b/arch/x86_64/kernel/smp.c Fri Mar 31 17:01:35 2006 +0100
83 @@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt
85 cpu = smp_processor_id();
86 /*
87 - * orig_rax contains the interrupt vector - 256.
88 + * orig_rax contains the negated interrupt vector.
89 * Use that to determine where the sender put the data.
90 */
91 - sender = regs->orig_rax + 256 - INVALIDATE_TLB_VECTOR_START;
92 + sender = ~regs->orig_rax - INVALIDATE_TLB_VECTOR_START;
93 f = &per_cpu(flush_state, sender);
95 if (!cpu_isset(cpu, f->flush_cpumask))
96 diff -r 7d239c83edea include/asm-x86_64/hw_irq.h
97 --- a/include/asm-x86_64/hw_irq.h Mon Mar 20 06:00:20 2006 +0000
98 +++ b/include/asm-x86_64/hw_irq.h Fri Mar 31 17:01:35 2006 +0100
99 @@ -127,7 +127,7 @@ __asm__( \
100 __asm__( \
101 "\n.p2align\n" \
102 "IRQ" #nr "_interrupt:\n\t" \
103 - "push $" #nr "-256 ; " \
104 + "push $~(" #nr ") ; " \
105 "jmp common_interrupt");
107 #if defined(CONFIG_X86_IO_APIC)