From nobody Sun Oct 25 10:16:31 2026 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 4jCCMz1sS1z6xrtb for ; Sun, 25 Oct 2026 10:16:31 +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 4jCCMz1FWlz3C3H for ; Sun, 25 Oct 2026 10:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792923391; 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=VEfuxX1IdTmORxn06s91Tb1oLqiSXyPtk6pLV7nRlCo=; b=BnOJUIjC0fSxQBLj5WQsoA6agxVFmmCEBuvIDkzeyI4FKnh8MB5MrTkTABIB5S0dbLHPic q/AcwQ7oFtvjdFye6m/L0t+288EcucIdILAaGYcUkANYJer/hIMqY9WXDoTTTZ6YzpPa9f qjJ33gg/cC+3N/ERlVnSIe7tvbN3bBJzermrKRgjZRoK0dZGuq7KhWYHSy/8hpMzcvK52F yD81Pfk70JaHdDxQBjvE7Hj4/gHBPhCPCEkrM5uI/EPWSTd5jgq9LmGMJdxJAR9BLi78NB tUU0p1ZZp6zl2gd2ZZxSz3B9CFtXyCSFGr+dtrH9ENozjeLx452anFcmweoaxg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792923391; b=hg7Y7wvm9eTWS9S/F3JGvnYd+bZtzkMcB8vKYNaZ9BIBqOFvqDLRIxhxEONKmsK80+4QEQ VRnB+Vmh6eHkKtVbFY1fHoV1s19lo8gkB7kgxviBrzfCcaFcNzMsN6XNSIANPtBk6PF2t5 Y1w9tWgDhZAgbLz5p5PXbyczIAjPOVn1SJ6DITYo3T5zZs12HF/IUOT41YYqJ1H/zH3pGv 06LLxUnYZJbfywrSSmcNyziRadp3Vymu3rE9vkQVa4LS7lwGUEEWYzbmXluPzTB0ZZ+fxt KDD2nSe3/Y5AcxNex7XDsEYG1+vx3KgDTmzZMyLDFjRtuYV0Ct9AeGLbRDo+nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792923391; 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=VEfuxX1IdTmORxn06s91Tb1oLqiSXyPtk6pLV7nRlCo=; b=P8aGKkpkgsZJVkXkGo+X6zgYkoy2pxjDJza0NsAVSju+UUd3IM+Ibj7OkfDc7TlGHlP2YE QqCF9aWO+ucGT+lIGf8B3Ey1IzPKzRPjZ5U3ZBLnUVfMHmkqFeCGWI32fYOAOwMxRUEdg9 EMlorB1OGlLTH0aSOvkVWZqgoXqL5DT2YMWMMULaSGKtKArTOx5MEVDopGuFqlur8n8W4r jUyGcqbukIs6vXl/KFOj0oQo5js/7jA5P6LibPEysY4IwrhsagVoIFXRmQqqCQgU5ZysZR OpwIbXiLcQbpcVCvXl3vzSEFHMnZiL520MjieNfdq9NVDl2elb9yBFexq55RJA== 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 4jCCMz0vWpzj23 for ; Sun, 25 Oct 2026 10:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3faeb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 25 Oct 2026 10:16:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 83f24cffba42 - stable/14 - powerpc: keep the VSX halves of the FPRs across back-to-back signals List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD 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/14 X-Git-Reftype: branch X-Git-Commit: 83f24cffba426fcdfce5de114048e666c62f15ea Auto-Submitted: auto-generated Date: Sun, 25 Oct 2026 10:16:31 +0000 Message-Id: <6addd6ff.3faeb.3c43f680@gitrepo.freebsd.org> The branch stable/14 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=83f24cffba426fcdfce5de114048e666c62f15ea commit 83f24cffba426fcdfce5de114048e666c62f15ea Author: Piotr Kubaj AuthorDate: 2026-10-15 19:18:16 +0000 Commit: Piotr Kubaj CommitDate: 2026-10-25 10:16:18 +0000 powerpc: keep the VSX halves of the FPRs across back-to-back signals grab_mcontext() only put the second halves of vs0-31 into the context while the thread owned the VSX unit, but sigreturn(2) gives ownership up so that the next use reloads the registers lazily. A signal that arrives right after a sigreturn, like one the handler's mask was holding back, got a context without them and its own sigreturn then zeroed them in the PCB. The halves saved in the PCB are current whenever the FP state is, since VSX instructions can't run without PCB_VSX and save_fpu() stores them in that case, so export them together with the FP registers. Reviewed by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60754 (cherry picked from commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d) (cherry picked from commit 0e9af9fb72884e77de79e37069a162e1563ca86b) --- sys/powerpc/powerpc/exec_machdep.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index 3f7318ef6a50..e0e20f7cddf8 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -422,13 +422,21 @@ grab_mcontext(struct thread *td, mcontext_t *mcp, int flags) for (i = 0; i < 32; i++) memcpy(&mcp->mc_fpreg[i], &pcb->pcb_fpu.fpr[i].fpr, sizeof(double)); - } - if (pcb->pcb_flags & PCB_VSX) { - mcp->mc_flags |= _MC_VS_VALID; - for (i = 0; i < 32; i++) - memcpy(&mcp->mc_vsxfpreg[i], - &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double)); + /* + * The second halves of VSR0-31 in the PCB are current + * whenever the FP state is: VSX instructions cannot run + * without PCB_VSX, and save_fpu() stores them when it is + * set. Export them regardless of whether the thread owns + * VSX at this moment, or a signal delivered right after a + * sigreturn loses them. + */ + if (cpu_features & PPC_FEATURE_HAS_VSX) { + mcp->mc_flags |= _MC_VS_VALID; + for (i = 0; i < 32; i++) + memcpy(&mcp->mc_vsxfpreg[i], + &pcb->pcb_fpu.fpr[i].vsr[2], sizeof(double)); + } } /*