From nobody Wed Jan 18 09:39:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nxghl07Hgz2sjSc; Wed, 18 Jan 2023 09:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nxghk5FFGz40fG; Wed, 18 Jan 2023 09:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q7H+/t2vuQt52/yQ4Ms3g+86eubimeQZjmNTgzrGWo=; b=KO+HZBKyWc4KE0aSP/ZEQDrME1BiUtTp/h8r11LAUnwOluQtUbStDGtoJCNmnNjnhlEegB 8hYCwsS9uuq/f2VscsgCv0GozE1wHgav2eCqwLwn3FO8jUIrKeKYmjMdVM/wrSvMcUndJ7 9wSPbm6XYWZl2GavhmhaC7tk9YiHBE4G45W0oePZfqtsOKlcIHiB4MHq2hP9/yOTd6yhCS OTFlrCFQgtequbkImx4e3IyMB03u76xmU5IikpA8Ae0UBusl9rIhOBrq2S0M1zsENS1a89 xRUenLvgibbYtrboI5cxgLcmjctneqPqyuS3CpKEl/q+niju1wtd6nrfOGo6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674034790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Q7H+/t2vuQt52/yQ4Ms3g+86eubimeQZjmNTgzrGWo=; b=Zch/UDFKg1eU3pseMBxpcvGauEgCKByt0y0x4BFR1wX09x3aJqt+qH1u7vJqYSzTcwR4va iCIbQU0fSm1jiZ3yUJimU/lcAaM7fAyxadgTndyLCT0lcjDjhbkI6+Q7QDv7IuHuqxKFYe zI6G8jS/jeqs0elqIaYEqSDcslPnRazP35sVUEBKqMjfj+bv3Pcj+pq46Oog3wJ/8F4pGs MbdzyyiZPfP/sUY/ERl0ZOphqXwjulm3vQPZfHAhjtzWA8I+yWgL1dirFwXim7eCMwLzY3 K95/ruYly6Ku8yc8bBLskAtuB7yWpoJ65ng8hRtMZn8Upytik9z5DYci1HDjyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674034790; a=rsa-sha256; cv=none; b=g2asX++4UQn0vmqYsG/AQ3FesLoYuNQY3ZouiwxUu1MfTqbJc0lCh/JhMqZP1gva8uhTvF ZdXRKGXV3C2rQ+YGfGn2xjTYvkW+XSeObV3HOvLHqOSJFiwm5l/2vwh9CfZeVI41VoC6DC P0MEkPm804AN8UWKVWuXU3/RJBy9Ku+KPSwkMZ+GM5xTH1nxBmttMyyUdVdZileyqNfNUK LgLM7dd5Q8jbBchmKG3frG3cXCWqiLa0ixugPMSYW/p9LFlG2iT8Cp6y3dSnvh3vZf3/tI aYOPqW9sH0gYNXdO9GD/icOgeX0Pct7QlXuhA7HfOfk2LYHjspNn0M0bcSKxrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nxghk4M2Fz161d; Wed, 18 Jan 2023 09:39:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30I9do6c053101; Wed, 18 Jan 2023 09:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30I9doJs053100; Wed, 18 Jan 2023 09:39:50 GMT (envelope-from git) Date: Wed, 18 Jan 2023 09:39:50 GMT Message-Id: <202301180939.30I9doJs053100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a85cf421d1bf - main - Reduce an arm64 VFP critical section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a85cf421d1bfec7e753bfee781355785b00d89d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a85cf421d1bfec7e753bfee781355785b00d89d4 commit a85cf421d1bfec7e753bfee781355785b00d89d4 Author: Andrew Turner AuthorDate: 2023-01-18 09:30:36 +0000 Commit: Andrew Turner CommitDate: 2023-01-18 09:31:50 +0000 Reduce an arm64 VFP critical section In set_fpcontext we only need a critical section around vfp_discard. The remainder of the code can run without it. While here add an assert to check the passed in thread is the current thread as the code already this. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38000 --- sys/arm64/arm64/exec_machdep.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c index 258cb5d26b13..27ee2f80858d 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -519,8 +519,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) #ifdef VFP struct pcb *curpcb; - critical_enter(); - + MPASS(td == curthread); if ((mcp->mc_flags & _MC_FP_VALID) != 0) { curpcb = curthread->td_pcb; @@ -528,7 +527,9 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) * Discard any vfp state for the current thread, we * are about to override it. */ + critical_enter(); vfp_discard(td); + critical_exit(); KASSERT(curpcb->pcb_fpusaved == &curpcb->pcb_fpustate, ("Called set_fpcontext while the kernel is using the VFP")); @@ -538,8 +539,6 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) curpcb->pcb_fpustate.vfp_fpsr = mcp->mc_fpregs.fp_sr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; } - - critical_exit(); #endif }