Skip to contentSkip to conversation

FPU stack fault handling

PATCH New Charles Coffing 1 participant 1 message Aug 5, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FPU stack fault handling

The sparse Linux trees have diverged from mainstream Linux in their handling of FPU errors. I think mainstream Linux is correct.

According to the Pentium developer's manual in section 7.1.9, a stack fault is a type of invalid operation. So stack faults will have the invalid op bit set. The attached patch restores this behavior.

(Something mangled my previous inline patch, so I'm attaching this one instead. Let's see if this one survives...)

--Charles

linux-2.6.7-xen-sparse/arch/xen/i386/kernel/traps.c +2 -2
@@ -722,8 +722,8 @@
 		default:
 			break;
 		case 0x001: /* Invalid Op */
-		case 0x040: /* Stack Fault XXX? */
-		case 0x240: /* Stack Fault | Direction XXX? */
+		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;
linux-2.4.26-xen-sparse/arch/xen/kernel/traps.c +2 -2
@@ -449,8 +449,8 @@
 		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;
 			break;
 		case 0x002: /* Denormalize */