diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/irq_32.c | 19 | ||||
-rw-r--r-- | arch/x86/kernel/irq_64.c | 2 | ||||
-rw-r--r-- | arch/x86/lguest/boot.c | 2 |
3 files changed, 9 insertions, 14 deletions
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index c80cf6699678..38da8f29a9c8 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
@@ -68,11 +68,10 @@ static inline void *current_stack(void) | |||
68 | return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); | 68 | return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline int | 71 | static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc) |
72 | execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | ||
73 | { | 72 | { |
74 | struct irq_stack *curstk, *irqstk; | 73 | struct irq_stack *curstk, *irqstk; |
75 | u32 *isp, *prev_esp, arg1, arg2; | 74 | u32 *isp, *prev_esp, arg1; |
76 | 75 | ||
77 | curstk = (struct irq_stack *) current_stack(); | 76 | curstk = (struct irq_stack *) current_stack(); |
78 | irqstk = __this_cpu_read(hardirq_stack); | 77 | irqstk = __this_cpu_read(hardirq_stack); |
@@ -98,8 +97,8 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | |||
98 | asm volatile("xchgl %%ebx,%%esp \n" | 97 | asm volatile("xchgl %%ebx,%%esp \n" |
99 | "call *%%edi \n" | 98 | "call *%%edi \n" |
100 | "movl %%ebx,%%esp \n" | 99 | "movl %%ebx,%%esp \n" |
101 | : "=a" (arg1), "=d" (arg2), "=b" (isp) | 100 | : "=a" (arg1), "=b" (isp) |
102 | : "0" (irq), "1" (desc), "2" (isp), | 101 | : "0" (desc), "1" (isp), |
103 | "D" (desc->handle_irq) | 102 | "D" (desc->handle_irq) |
104 | : "memory", "cc", "ecx"); | 103 | : "memory", "cc", "ecx"); |
105 | return 1; | 104 | return 1; |
@@ -150,19 +149,15 @@ void do_softirq_own_stack(void) | |||
150 | 149 | ||
151 | bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) | 150 | bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) |
152 | { | 151 | { |
153 | unsigned int irq; | 152 | int overflow = check_stack_overflow(); |
154 | int overflow; | ||
155 | |||
156 | overflow = check_stack_overflow(); | ||
157 | 153 | ||
158 | if (IS_ERR_OR_NULL(desc)) | 154 | if (IS_ERR_OR_NULL(desc)) |
159 | return false; | 155 | return false; |
160 | 156 | ||
161 | irq = irq_desc_get_irq(desc); | 157 | if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) { |
162 | if (user_mode(regs) || !execute_on_irq_stack(overflow, desc, irq)) { | ||
163 | if (unlikely(overflow)) | 158 | if (unlikely(overflow)) |
164 | print_stack_overflow(); | 159 | print_stack_overflow(); |
165 | generic_handle_irq_desc(irq, desc); | 160 | generic_handle_irq_desc(desc); |
166 | } | 161 | } |
167 | 162 | ||
168 | return true; | 163 | return true; |
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index ff16ccb918f2..c767cf2bc80a 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -75,6 +75,6 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) | |||
75 | if (unlikely(IS_ERR_OR_NULL(desc))) | 75 | if (unlikely(IS_ERR_OR_NULL(desc))) |
76 | return false; | 76 | return false; |
77 | 77 | ||
78 | generic_handle_irq_desc(irq_desc_get_irq(desc), desc); | 78 | generic_handle_irq_desc(desc); |
79 | return true; | 79 | return true; |
80 | } | 80 | } |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 161804de124a..a0d09f6c6533 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -1015,7 +1015,7 @@ static struct clock_event_device lguest_clockevent = { | |||
1015 | * This is the Guest timer interrupt handler (hardware interrupt 0). We just | 1015 | * This is the Guest timer interrupt handler (hardware interrupt 0). We just |
1016 | * call the clockevent infrastructure and it does whatever needs doing. | 1016 | * call the clockevent infrastructure and it does whatever needs doing. |
1017 | */ | 1017 | */ |
1018 | static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) | 1018 | static void lguest_time_irq(struct irq_desc *desc) |
1019 | { | 1019 | { |
1020 | unsigned long flags; | 1020 | unsigned long flags; |
1021 | 1021 | ||