From nobody Mon May 15 15:46:01 2023 X-Original-To: dev-commits-src-branches@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 4QKkHF6x5jz4Blmt; Mon, 15 May 2023 15:46:01 +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 4QKkHF69QPz3JRh; Mon, 15 May 2023 15:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684165561; 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=/AOQ188GcI+w2eCSR+xD14lbWORGk2T4K2jb7S6zvF8=; b=GYQaDx5XzIQ7Oikks/zB5151HqrwIJ1bQF93HpPBlr4p6IRvorw/hyFgVI46B4NesCMvNr kQ1oVHY8cp56GcfNlRU8eSIBX34c8vu3eDmZQzj38FqIfgU9pLW33dDLQH6FWUz6VISOS1 22mKVnR5Ki/EjcYegOx1MIWnoccEwPrYtMop08P0tM1XOFuIfW3z2tc1ZUgvqSWoj93Be3 M4NdVo8g4cxsiInO1MZ0LZiK1jEhWMQFdQOaLtiM4Cwg6suzp26Fw14rUrgcLBVzyyTGt1 gOfK6XlNc1/NGzZmcyw47ZjyrQxu6LEH53+NtLabx3ZuVWtDRdIxX9YH3uMv2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684165561; 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=/AOQ188GcI+w2eCSR+xD14lbWORGk2T4K2jb7S6zvF8=; b=CKxqTr+/zZpHYYmp+b24ZceStqEJLk1ITkbku5r5VRGiUGF/xHI3SVxZ4Z/sjkmquZtsVj ugSwnjNfjbHIo7HN+N//51uSo+xXB7iZC1+bK59b6Kbylm2YRPVoB5dPfA9+d3//87vSEL J7WHrAhLf31PJqMICD+qUzMKLa+HGbNmFEA4FGjN5NHvaFHhT0hyFAfCTGYu90wK3/2BYx 3iY8T+hlRk8JE9dg0WrT77f8JYJYNPw0YPI2t08Om7K0b06YyqDKOtfsQIrSAB3ZqeI5nt nyoT7n1xBhqZg6uvs+LH+UlwGEQbiN8T1CXScJCZ0Vaw7WADh3JrAPIQeqKU5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684165561; a=rsa-sha256; cv=none; b=A5bqrIBVEUaGZzhnTihvheum9BbWxVwW1CgzfKEVeivv/bJao/AMApOMaVCUaSHDvXUu88 dwbU0CHKc1tXLeuFE+Hls2J4w+PfXYy8oVNab16V1z+wVllPvYITBY0TuMr5zFuIZdeB+B dGRs7lRZGKvFTxWTM/CeVp/wvNDVutPwlAe1qEezAVcF+tS/7vCo6nigvVSEDTV0i2Y1FA YP0eHINvEcZd8HOnbzboBLT7K4DtQOFQtUpgSuDJTBOdLRg5Alktf1P3TXXICXiu8rwoCI mSsn3c0Ob3202oTSLzo5u/pyWtFI/ykjr+S85HuRveqM6lF4xwAHnd3+e1B5lg== 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 4QKkHF55Fkzm27; Mon, 15 May 2023 15:46:01 +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 34FFk10t073493; Mon, 15 May 2023 15:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34FFk1VY073492; Mon, 15 May 2023 15:46:01 GMT (envelope-from git) Date: Mon, 15 May 2023 15:46:01 GMT Message-Id: <202305151546.34FFk1VY073492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0ae7446ed3fa - stable/13 - Reduce an arm64 VFP critical section List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ae7446ed3faf51ce457178f538eca04b22774d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0ae7446ed3faf51ce457178f538eca04b22774d7 commit 0ae7446ed3faf51ce457178f538eca04b22774d7 Author: Andrew Turner AuthorDate: 2023-01-18 09:30:36 +0000 Commit: Andrew Turner CommitDate: 2023-05-15 10:54:57 +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 (cherry picked from commit a85cf421d1bfec7e753bfee781355785b00d89d4) --- 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 fab0ee2ba993..21435362f3e3 100644 --- a/sys/arm64/arm64/exec_machdep.c +++ b/sys/arm64/arm64/exec_machdep.c @@ -512,8 +512,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; @@ -521,7 +520,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")); @@ -531,8 +532,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 }