Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/arch/xen/i386 Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/89c9b13e0128
branches:  netbsd-3
changeset: 577729:89c9b13e0128
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Jan 11 17:10:31 2006 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1107):
        sys/arch/xen/i386/npx.c: revision 1.7
Make stts a no-op as clts already is
Always call HYPERVISOR_fpu_taskswitch() at the end of npxsave_lwp().
This fixes the FPU problems detected by paranoia on a NetBSD/Xen guest.
Based on patch sent by Paul Ripke on port-xen, but reworked by me.
Should fix port-xen/30977.

diffstat:

 sys/arch/xen/i386/npx.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (43 lines):

diff -r 7094c573db91 -r 89c9b13e0128 sys/arch/xen/i386/npx.c
--- a/sys/arch/xen/i386/npx.c   Wed Jan 11 17:03:37 2006 +0000
+++ b/sys/arch/xen/i386/npx.c   Wed Jan 11 17:10:31 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npx.c,v 1.3.14.1 2005/03/20 14:38:21 tron Exp $        */
+/*     $NetBSD: npx.c,v 1.3.14.2 2006/01/11 17:10:31 tron Exp $        */
 /*     NetBSD: npx.c,v 1.103 2004/03/21 10:56:24 simonb Exp    */
 
 /*-
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.3.14.1 2005/03/20 14:38:21 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npx.c,v 1.3.14.2 2006/01/11 17:10:31 tron Exp $");
 
 #if 0
 #define IPRINTF(x)     printf x
@@ -146,7 +146,7 @@
 #define        stts()                  lcr0(rcr0() | CR0_TS)
 #else
 #define        clts()
-#define        stts()                  HYPERVISOR_fpu_taskswitch()
+#define        stts()
 #endif
 
 int npxdna(struct cpu_info *);
@@ -749,7 +749,7 @@
 
        oci = l->l_addr->u_pcb.pcb_fpcpu;
        if (oci == NULL)
-               return;
+               goto end;
 
        IPRINTF(("%s: fp %s lwp %p\n", ci->ci_dev->dv_xname,
            save? "save" : "flush", l));
@@ -792,4 +792,6 @@
        KASSERT(ci->ci_fpcurlwp == l);
        npxsave_cpu(ci, save);
 #endif
+end:
+       HYPERVISOR_fpu_taskswitch();
 }



Home | Main Index | Thread Index | Old Index