From nobody Sun Oct 18 10:29:12 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 4j6vzy0mc5z6vLMx for ; Sun, 18 Oct 2026 10:29:18 +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 4j6vzx5P9lz4RkQ for ; Sun, 18 Oct 2026 10:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792319357; 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=jRKYA73boLYftYimr/W2tQk58VThz4CvmS2QBOBcZus=; b=m5lqDP77LqNZ03P5IuLPrynmAwGi6qIXqTLS1jUdp7h+C/1zrRi29nvFnNglpr/lJu+r3v vWJslSmvU5tivjkx8jkZnCwYReUjJmvX6B/m7pEZHBUvzkr99QD3IDfoXslNWJcnKmlGf1 zY7fPEIFTYki1hN1y+94AuNjuJl220LEqrZ/LyM4hOfxEDIdu+9OHrcG4QWR7EK7iZbC+C BmWdtOuj/DutDBYfcJ1mRph5KZS53oKjWRYpQrBqSHHzTzRXSil8YEAoRNv/ptI/jseqCG ysKLL4v1owh6XJbLiyrt+4Kd1x4aAthRyGWCmHXcCoV+/TWMD2WmBmhTiCVGkA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792319357; b=MaBj3Zz+jVE/iM9unv2kZ7UrN8hhLHCQIlSCFykAVrqA4fmn+OjgFCwOlCvWh5saolqU3A abQ8TaMpCiY/pTnnkXfX1gl+gbybHf08yHMrXM+j+zVmCx5e8aIXTp0tJrB8rwcPJmB5Pt xPrFZGmvmOzn9Rd5uGKqoFTUw3eOy1jmQDCZJJ0t6VLwGi2KNx3GzlCPa8ZOFchWKIpTmJ V8N/JWeOZmoWlAXIItAujedzxTvstzkJ09uJoWc7vGE8VXKE5ELa/Cv9ZxDIpouql2Dc+p 2Fd0CMFZZzXbxsZeN+HzdrjwjsM6EzX81sAC/D6qfc90RB0y8YgWHlpijKOrUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792319357; 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=jRKYA73boLYftYimr/W2tQk58VThz4CvmS2QBOBcZus=; b=g4sI+suwzaLNPAKnNKLrrrRZZAu3NdDgBdohq/Gr65joUZANu7tZX2PEx1/aGIGliXaDBU TilRyPg8Bqco1zfX7urF/Iac6N65ytdvCE6e6eQPhjhy09tg3apy5XL/TSr8epeq+dl8bq hnU5+B1NAFw4814KjDAWf38Od3j7bpWSilqJ7qpTcTihm/k3zSez5xM/IMt/edP4SXEScw DdaNItgmz+Cbcjj3rdITDeRm49//kHt3cT61YVj/D6zgKvd6pEC6p27zwrAfjy5N5minpu veHz7HVkeg12YxQMMj67374sivVAGAz3gP20dt7VnkJ2URZD0+Vg1VN+Nglntw== 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 4j6vzx4n9tzlqC for ; Sun, 18 Oct 2026 10:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18b36 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 18 Oct 2026 10:29:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 64b2fea9a2f9 - main - powerpc: keep the VSX halves of the FPRs across back-to-back signals 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: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d Auto-Submitted: auto-generated Date: Sun, 18 Oct 2026 10:29:12 +0000 Message-Id: <6ad49f78.18b36.743c2da9@gitrepo.freebsd.org> The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d commit 64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d Author: Piotr Kubaj AuthorDate: 2026-10-15 19:18:16 +0000 Commit: Piotr Kubaj CommitDate: 2026-10-18 10:29:04 +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 --- 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 7192feae6055..68a52c463ce3 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)); + } } /*