Module Name: src
Committed By: riz
Date: Wed Feb 22 19:07:31 UTC 2012
Modified Files:
src/sys/arch/i386/i386 [netbsd-6]: machdep.c
Log Message:
Pull up following revision(s) (requested by bouyer in ticket #32):
sys/arch/i386/i386/machdep.c: revision 1.719
i386_switch_context(): mimic code in cpu_switchto() and compare pcb->pcb_fpcpu
against ci to decide if we need to turn off FPU. Fix FPU corruption, e.g.
paranoia occasionally reporting flaws on Xen/MP systems.
XXX is ci_fpused still needed at all ?
To generate a diff of this commit:
cvs rdiff -u -r1.717 -r1.717.2.1 src/sys/arch/i386/i386/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.717 src/sys/arch/i386/i386/machdep.c:1.717.2.1
--- src/sys/arch/i386/i386/machdep.c:1.717 Thu Jan 12 19:49:37 2012
+++ src/sys/arch/i386/i386/machdep.c Wed Feb 22 19:07:12 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $ */
+/* $NetBSD: machdep.c,v 1.717.2.1 2012/02/22 19:07:12 riz Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717.2.1 2012/02/22 19:07:12 riz Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -544,9 +544,8 @@ i386_switch_context(lwp_t *l)
pcb = lwp_getpcb(l);
ci = curcpu();
- if (ci->ci_fpused) {
+ if (pcb->pcb_fpcpu != ci) {
HYPERVISOR_fpu_taskswitch(1);
- ci->ci_fpused = 0;
}
HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_esp0);