Here is a patch for FPU context switching in SMP. A copy_thread() function clears PF_USEDFPU flag for a new thread, but it does not clear the PSR_EF bit. Thus, a first FPU exception called from the child thread is not handled properly. I made the patch after PPC and MIPS architectures - both clear a similar bit in copy_thread. This bug does not exist in the UP kernel, probably because it does not rely on PF_USEDFPU flag.
The patch below should be applied for both 2.4 and 2.6 branches. I tested it with a test-fenv program from glibc testsuite. The test fails the same test cases in both SMP and UP with the patch applied. Without the patch, the test on SMP kernel failes in almost two times more testcases. Regards, Krzysztof ---------------------------------------------------- Reklama Twojej strony WWW już od 20 groszy? - Oczywiście! To nie jest żadna ściema! - Sprawdź: http://klik.wp.pl/?adr=http%3A%2F%2Fbiznes.szukaj.wp.pl%2Fboksy.html&sid=299
copy_thread-fpu.24.patch
Description: Binary data