]> git.baikalelectronics.ru Git - kernel.git/commit
[AVR32] Fix random segfault with preemption
authorPhilippe Rétornaz <philippe.retornaz@epfl.ch>
Wed, 10 Oct 2007 22:52:24 +0000 (18:52 -0400)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Thu, 11 Oct 2007 11:32:56 +0000 (13:32 +0200)
commit9d245caac45a6c374eaa0e6f8eb71adac6b1c158
treeecf3548140022204214b20f6f69dfc67a6e026b9
parent802c65fabff2b872c0a81abacbd90e6aa9cdd032
[AVR32] Fix random segfault with preemption

As explained on:
http://www.avrfreaks.net/index.php?nameÿphpBB2&fileÿewtopic&tS307
If the current process is preempted before it can copy RAR_SUP and
RSR_SUP both register are lost and the process will segfault as soon
as it return from the syscall since the return adress will be
corrupted.

This patch disable IRQ as soon as we enter the syscall path and
reenable them when the copy is done.

In the interrupt handlers, check if we are interrupting the srrf
instruction, if so disable interrupts and return. The interrupt
handler will be re-called immediatly when the interrupts are
reenabled.

After some stressing workload:
 - find / > /dev/null in loop
 - top (in ssh)
 - ping -f avr32

The segfaults are not seen anymore.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
arch/avr32/kernel/entry-avr32b.S