From nobody Sun Nov 22 19:28:57 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 4jXfJV10H4z72bxn for ; Sun, 22 Nov 2026 19:28:58 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jXfJT5lc0z4V92 for ; Sun, 22 Nov 2026 19:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795375737; 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=RvWaCNBvKuSf/THAhafIpE4+zhWiMHfPigCZi4odiBM=; b=efgooIWUlsq7QsDC62nEQhLK/hRZywvm4v+zYG68QATyf8VU4a8WITYomdHH1yEQoJ+HlE EBEoPpmctvEhVsewOfYqMqibd0dOaeVvH6wGMjFPTidCdk2Z5/Md35S2vFpn/Q0PiInHRB BwI4llZREbiaX6PiN3DbyoOPCYoaPQU+JdnjJgtjf5aK66118gapwUxT8ZCxTbqfN+/B0s iwbN28byamK48EoTiCRbDe/LpBBtGVz55ShBZ8Ekshk2ozfudX9DAfzOeo79ukLTqJ9puA aTEtCOjVO0W2PzW7RcmDz0Ybc+PfXK66B7ywUHoF7wz6qKD+y5U2XQq8/VvxVw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795375737; b=uSEGkA0YrG4dOiojzdze0KbHpdVHF1yGkDiMlQh22oIFRINZwaHS+NEzikUtomPY1nwl/c AmAdvsCFOYu/Fd0JgjdcaXmT14bX5kd3/KWHQ8BXSKnFpjqr/Y8LVTB1lDbQUBhJYMUNOa P1ZDIrBv3kyGaEqoWuM5tEE68D/V0RRFDGLGJv2wvKUrqHX9ri7lxh0paMHk8EwmZDqa3R 3EWSR0DU/F2Ujq2euGwTYsp2a3uWmCRUlcrAkYPBqO47WAXDCwSp+1dMlOw2qa80++9CaR WvENsJaX8WV+Z+PbejnDSjZIXEjXlSKyPjYN+A0F6h3GwC469/qxbV13h/Lijg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795375737; 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=RvWaCNBvKuSf/THAhafIpE4+zhWiMHfPigCZi4odiBM=; b=kFRDLXof4OrCXli1FxW2/IFYHP+u8Kg9pn9nVZZTEiloeMnCAe2oi3W+XwMGosVKdPrAEy M7EY/OIRRVKxlmOP4Hi19kyMQCsIOwsrTD0Uaf4v/ri7A98YuH3EWIIUOfx9LZbircTvH6 4NvN7HKn5p7BlVGgh771uzWipGKRGqRAzTrmijvxc9knEwiQGSh2EuEdPVqGQFEBxSpOwv dglZO1PTfIcMeKMzUVtmk7NNIljzw+PXY7LIah+ppSRkKUaT3mTMw7BJxIXFHiTmBaer/4 J5fQWPMewWZJmz1eSfATzLfUG7R298Jmc/iDGVFlQdJ5+XwGUlUGV67wO8wZng== 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 4jXfJT5Q3zzGHx for ; Sun, 22 Nov 2026 19:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26187 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Nov 2026 19:28:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 76eb059d05d6 - stable/15 - powerpc: don't drop FPU and VMX ownership in grab_mcontext() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: 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: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 76eb059d05d6689449519d9cc3d85694698161f6 Auto-Submitted: auto-generated Date: Sun, 22 Nov 2026 19:28:57 +0000 Message-Id: <6b034279.26187.29171c6a@gitrepo.freebsd.org> The branch stable/15 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=76eb059d05d6689449519d9cc3d85694698161f6 commit 76eb059d05d6689449519d9cc3d85694698161f6 Author: Piotr Kubaj AuthorDate: 2026-10-18 10:41:36 +0000 Commit: Piotr Kubaj CommitDate: 2026-11-22 19:28:39 +0000 powerpc: don't drop FPU and VMX ownership in grab_mcontext() grab_mcontext() saved the FP and vector registers with save_fpu() and save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while PCB_FPU stays set and the thread keeps using the unit. A later cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save, since save_fpu_nodrop() only saves for the thread that owns the unit, and the child got the registers as they were at the getcontext() or signal rather than at the fork. Use the nodrop variants. A child forked after getcontext() saw the parent's f14 as it was at the getcontext(); it sees the current value now. Reviewed by: adrian, jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60837 (cherry picked from commit 8a79b6398f06f31947a2dada576c5f489c69d498) --- sys/powerpc/powerpc/exec_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index a248aeeafaf7..8b02d5cf19be 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -414,7 +414,7 @@ grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) KASSERT(td == curthread, ("get_mcontext: fp save not curthread")); critical_enter(); - save_fpu(td); + save_fpu_nodrop(td); critical_exit(); } mcp->mc_flags |= _MC_FP_VALID; @@ -448,7 +448,7 @@ grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) KASSERT(td == curthread, ("get_mcontext: altivec save not curthread")); critical_enter(); - save_vec(td); + save_vec_nodrop(td); critical_exit(); } mcp->mc_flags |= _MC_AV_VALID;