x86: irq: fix apicinterrupts on 64 bits
authorAlexander van Heukelum <heukelum@mailshack.com>
Thu, 13 Nov 2008 12:50:20 +0000 (13:50 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 14 Nov 2008 01:28:38 +0000 (17:28 -0800)
Impact: Fix interrupt via the apicinterrupt macro

Checkin 939b787130bf22887a09d8fd2641a094dcef8c22 changed the
"interrupt" macro, but the "interrupt" macro is also invoked
indirectly from the "apicinterrupt" macro.

The "apicinterrupt" macro probably should have its own collection of
systematic stubs for the same reason the main IRQ code does; as is it
is a huge amount of replicated code.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/kernel/entry_64.S

index 2b42362a85b292d4091a3ebfbafc75eb6c8dd467..369de6973c58646036c548e4b35a8e27dcf64d68 100644 (file)
@@ -675,9 +675,8 @@ END(interrupt)
  * Entry runs with interrupts off.     
  */ 
 
-/* 0(%rsp): ~(interrupt number)+0x80 */ 
+/* 0(%rsp): ~(interrupt number) */
        .macro interrupt func
-       addq $-0x80,(%rsp)              /* Adjust vector to [-256,-1] range */
        cld
        SAVE_ARGS
        leaq -ARGOFFSET(%rsp),%rdi      /* arg1 for handler */
@@ -711,9 +710,14 @@ END(interrupt)
        call \func
        .endm
 
+       /*
+        * The interrupt stubs push (~vector+0x80) onto the stack and
+        * then jump to common_interrupt.
+        */
        .p2align CONFIG_X86_L1_CACHE_SHIFT
 common_interrupt:
        XCPT_FRAME
+       addq $-0x80,(%rsp)              /* Adjust vector to [-256,-1] range */
        interrupt do_IRQ
        /* 0(%rsp): oldrsp-ARGOFFSET */
 ret_from_intr: