Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S272690AbTHKOGi (ORCPT ); Mon, 11 Aug 2003 10:06:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S272616AbTHKNmi (ORCPT ); Mon, 11 Aug 2003 09:42:38 -0400 Received: from pix-525-pool.redhat.com ([66.187.233.200]:38539 "EHLO lacrosse.corp.redhat.com") by vger.kernel.org with ESMTP id S272615AbTHKNlD (ORCPT ); Mon, 11 Aug 2003 09:41:03 -0400 To: torvalds@transmeta.com From: davej@redhat.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH] Message-Id: Date: Mon, 11 Aug 2003 14:40:24 +0100 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1359 Lines: 30 >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: diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/traps.c linux-2.5/arch/i386/kernel/traps.c --- bk-linus/arch/i386/kernel/traps.c 2003-06-26 19:49:20.000000000 +0100 +++ linux-2.5/arch/i386/kernel/traps.c 2003-06-26 20:11:29.000000000 +0100 @@ -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 */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/