From nobody Fri Aug 14 21:00:29 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 4hMF4M27JTz6nlGB for ; Fri, 14 Aug 2026 21:00:35 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hMF4M1N5Nz3Xxn for ; Fri, 14 Aug 2026 21:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786741235; 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=i+Pm3H/W6nEiYHmwA9HEJtZKozZwBM7S1uebrpTDoWs=; b=KpgIQ5bso6JbAjBwit7it06FES2A66V6d9j2pJ5dBgg3ksYn7VZJwEFvhMpW5Dpzmnnibi y43GgigN2PPj+R6l+QGheal8zReUwRXBvsfhjMK1UIQemUbpccjfC+ZiM9FMJgDVpdzPFM fz60VqHRpat/IdpZD4CgjqP+8KNU3YpJXel4774ll9s4D2I0yOHCTTEswezBHTY5WcD900 nGtdtXMWhscXEOKPgPObYKlItMzef3VwtB0RGokhCUlNcx6H11r6MfZx3rGhVBhtdnzwWd OsmKGvTuVu2+zeGeFLUWqKgoMaaRZTOrp/qc1XoZbMl+lZcO4soBwUUqMnyxlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786741235; a=rsa-sha256; cv=none; b=H7zIHuMiN0Lwo8aNs4PvhqD5MKuwrLNHkOWP0NkkV+IbTxWW1EFtrI/xAqMb2Lr1ezH5qn sc1iC8cR9kQZqhPF3OE1vW53bSE5Ob5yM8qgvLynrz17g+ItYtXquxBJBtsrT+lw1MN/fH i3FSFsPM3ugAs6+QUR2ixGnnVb747whRorD6C8XMTEBdPjS5v+cYSGRJcBl6v1xzzJ7mt+ vqDhQ/AjCcbEEBzFIQPySCWnPdOqeZh/Yer9bOp9Nle7Yq53g6tAJPL2Xu0JM8ppc+u8jD vbiUu22/w3i49MjzkyApDvievKOdEG7Ao1xRPJxapL1GhfhOwIfT7v+TdDomxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786741235; 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=i+Pm3H/W6nEiYHmwA9HEJtZKozZwBM7S1uebrpTDoWs=; b=FN4LZC7ZwJIKuNLJ+9PkDYmR12vg5/Tg59C3hMXibDXVsmTJIoy4JTDw+Mxjo6h5/V5uKO TzovT+oHB7vXgzPvjolOIlOYUg7As26wPnp7VS7WfhkwCk51R7lWPXgqNqHTwieE2QWnKS WqhhDulbBCptljXrzkb+Mp35sYUuG0nEY0PxN7WKv1frQPUoFgHr1ZvpCdIC+vj4XQ7hWW juyH73tCnBaojH//U0HODBN3IHG7A2t7aga6TwEoXrKcIKgpcvh0KuBxsgyRKc1RI9dd3N 8H4CY2ZnM+rws/cyr3y/g8lb9c+HePY3DO77YmvxlHTHadv3FQGym1kfHPIogg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hMF4M05R4zHq for ; Fri, 14 Aug 2026 21:00:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e435 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 14 Aug 2026 21:00:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 6fa9c2b1d282 - main - arm64: close a race in SVE register management 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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/main X-Git-Reftype: branch X-Git-Commit: 6fa9c2b1d2824034268646e0744e5e010155ffaf Auto-Submitted: auto-generated Date: Fri, 14 Aug 2026 21:00:29 +0000 Message-Id: <6a7f81ed.3e435.11f2b2f0@gitrepo.freebsd.org> The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa9c2b1d2824034268646e0744e5e010155ffaf commit 6fa9c2b1d2824034268646e0744e5e010155ffaf Author: Alan Cox AuthorDate: 2026-08-07 21:51:04 +0000 Commit: Alan Cox CommitDate: 2026-08-14 20:57:35 +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(). Assisted-by: Claude Code (Opus 5) Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58723 --- 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);