From nobody Mon Oct 12 00:43:16 2026 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 4j2zGY0C9Zz6wQ4J for ; Mon, 12 Oct 2026 00:43:17 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j2zGX59Ysz4BGy for ; Mon, 12 Oct 2026 00:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791765796; 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=zxgZB9E+zEdhsoG89hFeJH9pRFEgGlUREO37l16DZIE=; b=mVuyxqwfkH/O21DBM9wRr/Rn9EsccEdYjLfVzteYg7IZpRJ0YYVLCQOfJWYa7T5MDTQOFG R42cmS5U3CkmMP8norx6iHp83lGwsOOUufTyo9Gv8JoUC1XEZTTUm5oKjJ/0ZlC2uoEHOi HofTcKTK2EwaJCsLnlOToMblLVGW9h5esIWArnPzk6D3pqkp3lsC/FbDlc/ORVs+zNfk+W T42U9pKayu0+foMREnwaUJWGNITNKkQ7z/7PBJYFFmdqYkx1hiz+WdglCzBnjnrXmz9bFI zuwUapcWwEKw3G880jS5e+mh1Xg31eSe1QD9wOfZJ3so4uV7SJOtDSQ2sJTW5A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791765796; b=SbJIhmGYv5xtsoPKK7vQYv6K0bRnXbseUDTTydpnkTnuFhFjamCubpmr082U6gXzbIzs9j mIXM2fj3e94Qe9b6MXwlLf4nhDlAyvSJzi0vt4U/Z3Pvz3Qh38rnLXSbk0qa5gi+aVDhKB ZfmbMQPvuDLedslns5mQ4OJMDCSfr8gBiRtXddY6vSOhivFDfvnb0bk+Cyt8wR6exAXSlT ZqgYjrqMpIDdsZ6FijG75yBMZU2E2BECBlxOTD6IgQPwXOV54BcPjzaSPNEzNMXB6HaLIv 0VCsM2tVCO73/Lsd6A137Hls3DAJh5II8hxZQ3dZcFstGd8VEaONX8CKkKhg3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791765796; 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=zxgZB9E+zEdhsoG89hFeJH9pRFEgGlUREO37l16DZIE=; b=h6FEmCE2xIl7YkM0uf+Yy3dmukntUm8UjpFbhn//FvOLPYueURPCfkgqKzrp6tLhx7DepM yWvJqxBqPgQIxxu4HqdugSAcdOxO8b8sqvMMbksvGqSzlds51mV+tSwF82SlrsXGOAgwN1 zqVSP7OrmbY+8cqdIGHPhcx5E2GaehmVusc0v6tjz5k1GCloRYAINKfbPnfIQS+AUkgxr2 xiS3Hq54Bu/WNyVd7XdhL4fxz+/nDRmiivKNIxLQ2+TTR/K5vlEUg3kh71zIt3WavDrxbZ knlNnxhb1BKLaZK0FCqjFxtNzhceMTsGsotRNG4haWqHEcmRvSUFEfyS6aNz9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j2zGX4DTPz15Km for ; Mon, 12 Oct 2026 00:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35bae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 12 Oct 2026 00:43:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Cox Subject: git: e4ac63ef407e - stable/15 - arm64: close a race in SVE register management List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e4ac63ef407eec42945b49e7e0d20cfffc24f685 Auto-Submitted: auto-generated Date: Mon, 12 Oct 2026 00:43:16 +0000 Message-Id: <6acc2d24.35bae.4843a3f3@gitrepo.freebsd.org> The branch stable/15 has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=e4ac63ef407eec42945b49e7e0d20cfffc24f685 commit e4ac63ef407eec42945b49e7e0d20cfffc24f685 Author: Alan Cox AuthorDate: 2026-08-07 21:51:04 +0000 Commit: Alan Cox CommitDate: 2026-10-11 23:04:24 +0000 arm64: close a race in SVE register management While testing an unrelated pmap change, D58708, that dramatically reduces the number of TLBI instructions performed, and likely the timing of unrelated events, I started seeing "Storing an invalid VFP state" panics in vfp_save_state_common(). However, the origin of this panic is elsewhere, in the else branch of sve_restore_state(). Specifically, my pmap change seems to have increased the likelihood that the thread executing the else branch would be preempted by another thread between the critical_exit() inside the else branch's call to vfp_restore_state_common() and its own call to critical_enter(). Prior to expanding the scope of the else branch's critical section, the MPASS added by this change would fire, catching the problem at its source, rather than later in vfp_save_state_common(). (cherry picked from commit 6fa9c2b1d2824034268646e0744e5e010155ffaf) --- sys/arm64/arm64/vfp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index d4c0eacf690c..11faa4cc21cd 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -797,15 +797,17 @@ sve_restore_state(struct thread *td) critical_exit(); } else { + critical_enter(); + vfp_restore_state_common(td, curpcb->pcb_fpflags); /* Enable SVE if it wasn't previously enabled */ if ((curpcb->pcb_fpflags & PCB_FP_SVEVALID) == 0) { - critical_enter(); + MPASS(PCPU_GET(fpcurthread) == td); sve_enable(); curpcb->pcb_fpflags |= PCB_FP_SVEVALID; - critical_exit(); } + critical_exit(); } return (true);