Lazy FPU handling in ptrace
diff mbox series

Message ID 20030314205633.GA7373@averell
State New, archived
Headers show
Series
  • Lazy FPU handling in ptrace
Related show

Commit Message

Andi Kleen March 14, 2003, 8:56 p.m. UTC
While working on some x86-64 ptrace problems I noticed that i386 
has bugs in this area too. 

Before doing PTRACE_SETFPREGS or PTRACE_SETFPXREGS you need to do
an unlazy_fpu(), otherwise there is no guarantee that the changed
state will be picked up.

Patch for 2.4, but 2.5 seems to have it too.

(untested, but obviously correct ;-)
-Andi 


-
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/

Patch
diff mbox series

--- linux-work/arch/i386/kernel/ptrace.c-o	2002-08-08 10:27:42.000000000 +0200
+++ linux-work/arch/i386/kernel/ptrace.c	2003-03-14 21:51:21.000000000 +0100
@@ -381,6 +381,7 @@ 
 			ret = -EIO;
 			break;
 		}
+		unlazy_fpu(child);
 		child->used_math = 1;
 		set_fpregs(child, (struct user_i387_struct *)data);
 		ret = 0;
@@ -405,6 +406,7 @@ 
 			ret = -EIO;
 			break;
 		}
+		unlazy_fpu(child);
 		child->used_math = 1;
 		ret = set_fpxregs(child, (struct user_fxsr_struct *)data);
 		break;