From owner-svn-src-head@freebsd.org Tue Nov 21 13:19:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C53A8DEEA7D; Tue, 21 Nov 2017 13:19:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9245D6E3AB; Tue, 21 Nov 2017 13:19:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALDJch8074077; Tue, 21 Nov 2017 13:19:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDJcNt074076; Tue, 21 Nov 2017 13:19:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201711211319.vALDJcNt074076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 21 Nov 2017 13:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326056 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 326056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:19:39 -0000 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 |