Port-xen archive

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

Re: port-xen/30977: FPU troubles



On Tue, Jan 03, 2006 at 09:21:52PM +0100, Manuel Bouyer wrote:
> On Mon, Dec 19, 2005 at 09:34:01AM +1100, Paul Ripke wrote:
> > OK, I've had a closer look at this, and come up with the included patch,
> > which appears to work fine for me, with threaded and non-threaded 
> > programs.
> > I can't repeat the behaviour of the FPU state being not being restored,
> > restored to the wrong thread, or wiped.
> 
> This is great, many thanks ! I commited the attached patch, which

 here is the patch

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: npx.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/i386/npx.c,v
retrieving revision 1.6
diff -u -r1.6 npx.c
--- i386/npx.c  24 Dec 2005 20:07:48 -0000      1.6
+++ i386/npx.c  3 Jan 2006 19:09:33 -0000
@@ -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