Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19eadf98 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds
Browse files

[PATCH] x86: increase interrupt vector range



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: default avatarIan Pratt <ian.pratt@xensource.com>
Signed-off-by: default avatarChristian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bd9e0b74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;			\
+2 −2
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -115,8 +115,8 @@ int show_interrupts(struct seq_file *p, void *v)
 */
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();
+2 −2
Original line number Diff line number Diff line
@@ -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))
Loading