From 0988831a9cc37e7bdf4f1a6ac2510461b614931f Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Wed, 13 Aug 2003 09:08:35 -0700 Subject: [PATCH] [PATCH] Fix x87 FPU exception status check From Dave Richards (drichards@mahinetworks.com) "While diagnosing an MMX/FPU problem I found a minor problem in the code which diagnoses and generates signals for FPU exceptions. On x86 Stack Fault Exception are a subclass of Invalid Operation. Thus, the FPU status register will have both the SF and IF bits set when a stack fault occurs. The code which turns FPU exceptions into signals was assuming IF would be clear". --- arch/i386/kernel/traps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 8759fa4758ff6..2edd55db64d06 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -629,9 +629,10 @@ void math_error(void *eip) default: break; case 0x001: /* Invalid Op */ - case 0x040: /* Stack Fault */ - case 0x240: /* Stack Fault | Direction */ + case 0x041: /* Stack Fault */ + case 0x241: /* Stack Fault | Direction */ info.si_code = FPE_FLTINV; + /* Should we clear the SF or let user space do it ???? */ break; case 0x002: /* Denormalize */ case 0x010: /* Underflow */ -- 2.53.0