Author: andrew
Date: Tue Nov 21 13:19:38 2017
New Revision: 326056
URL: https://svnweb.freebsd.org/changeset/base/326056

Log:
  When fpcurthread is not the current thread it may be non-NULL. In this
  case another thread has had the VFP unit enabled and will have its state
  in the VFP registers along with it stored in memory. As such we don't need
  to store the state, but do need to zero the fpcurthread pointer to stop
  the VFP driver from using the enable fast path.
  
  Reported by:  emaste
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm64/arm64/vfp.c

Modified: head/sys/arm64/arm64/vfp.c
==============================================================================
--- head/sys/arm64/arm64/vfp.c  Tue Nov 21 13:17:40 2017        (r326055)
+++ head/sys/arm64/arm64/vfp.c  Tue Nov 21 13:19:38 2017        (r326056)
@@ -273,11 +273,8 @@ fpu_kern_enter(struct thread *td, struct fpu_kern_ctx 
                critical_enter();
                if (curthread == PCPU_GET(fpcurthread)) {
                        vfp_save_state(curthread, pcb);
-                       PCPU_SET(fpcurthread, NULL);
-               } else {
-                       KASSERT(PCPU_GET(fpcurthread) == NULL,
-                           ("invalid fpcurthread"));
                }
+               PCPU_SET(fpcurthread, NULL);
 
                vfp_enable();
                pcb->pcb_fpflags |= PCB_FP_KERN | PCB_FP_NOSAVE |
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to