Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 i386_switch_context(): mimic code in cpu_...



details:   https://anonhg.NetBSD.org/src/rev/6318f21a0136
branches:  trunk
changeset: 777550:6318f21a0136
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Feb 22 18:35:26 2012 +0000

description:
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 ?

diffstat:

 sys/arch/i386/i386/machdep.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 442a9050dbcd -r 6318f21a0136 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Feb 22 18:29:31 2012 +0000
+++ b/sys/arch/i386/i386/machdep.c      Wed Feb 22 18:35:26 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.718 2012/02/19 21:06:08 rmind Exp $      */
+/*     $NetBSD: machdep.c,v 1.719 2012/02/22 18:35:26 bouyer 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.718 2012/02/19 21:06:08 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.719 2012/02/22 18:35:26 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -542,9 +542,8 @@
 
        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);



Home | Main Index | Thread Index | Old Index