From e94aa61b6820e34732840139dbe3f2016c6f1e24 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Fri, 5 Aug 2011 00:15:50 +0000 Subject: 2011-08-04 Till Straumann * shared/irq/irq_asm.S: BUGFIX (introduced by SMP changes which moved code around, apparently): *must* store i8259 mask to frame *before* switching to IRQ stack. The code retrieves the mask after switching back to original stack. Also, the IRQ stack has no reserved space for the mask; storing it there could overwrite memory! --- c/src/lib/libbsp/i386/ChangeLog | 9 +++++++++ c/src/lib/libbsp/i386/shared/irq/irq_asm.S | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/c/src/lib/libbsp/i386/ChangeLog b/c/src/lib/libbsp/i386/ChangeLog index c093bca7f2..8d41b7b131 100644 --- a/c/src/lib/libbsp/i386/ChangeLog +++ b/c/src/lib/libbsp/i386/ChangeLog @@ -1,3 +1,12 @@ +2011-08-04 Till Straumann + + * shared/irq/irq_asm.S: BUGFIX (introduced by SMP changes + which moved code around, apparently): *must* store i8259 + mask to frame *before* switching to IRQ stack. The code + retrieves the mask after switching back to original stack. + Also, the IRQ stack has no reserved space for the mask; + storing it there could overwrite memory! + 2011-08-01 Jennifer Averett PR 1802 diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S index e644e7587c..a0a00e944c 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S +++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S @@ -76,6 +76,8 @@ SYM (_ISR_Handler): movl ebx, EBX_OFF(esp) movl eax, ESP_OFF(esp) movl ebp, EBP_OFF(esp) + movw SYM (i8259s_cache), ax /* save current i8259 interrupt mask */ + movl eax, MSK_OFF(esp) /* save in stack frame */ #ifdef __SSE__ /* NOTE: SSE only is supported if the BSP enables fxsave/fxrstor @@ -142,8 +144,7 @@ nested: /* * acknowledge the interrupt */ - movw SYM (i8259s_cache), ax /* save current i8259 interrupt mask */ - movl eax, MSK_OFF(esp) /* save in stack frame */ + movw SYM (i8259s_cache), ax /* fetch current i8259 interrupt mask */ /* * compute the new PIC mask: -- cgit v1.2.3