From nobody Sun Oct 25 09:57:40 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 4jCByD4jJrz6xqZy for ; Sun, 25 Oct 2026 09:57:40 +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 4jCByD408rz4sMW for ; Sun, 25 Oct 2026 09:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792922260; 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=LNvjFSZAmKjyxlsVqzQRCtubBVudc5fNOotjl2c0zTY=; b=p2PVceLSNIPqQptK/20BZTxCbamJj2GEwzH46hieyFpKEoXHUSOByrTerjy+9vsLThnOVs ir+OT0zflwQNhWZK0PGJbGROw85uoxFaZ/mAevR+zYSdqAm4ZSRkw/IkFeIKzwVoamxt/I tiazCTeODkdmuLje7B7MBbiv1MAN6Wyq8nXDMgo7MnM2Tbw8ZK8JYLiFgasIOv2Ucawlls ykWADLAvj4ZR7yhfFqJYcdROPEMklnW9Ztmy+5dj8Y1PXImnxJnC+TPX3bavMSIXyY/LhU h/eekbH+9UyXhMLk1aGq2bIcPCVujBFY3r10M7ZQ8fEhtQ7jJRIBdvVzfYa34w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792922260; b=ZnHsGPb7LWj/rCF/3xvGoBxr1oW2Kgs+eghxPNZDjMAMOzd/kRfLP80a2qcJ2jLkhw4yRu 5UZ1EN8OilZqZASW2v/Pf4rCmJvQEaqshJIg0ThJ45DMGw3M8/LGVUg0FTip0ZomMKHHIM zT3yiszlXKnGOwWWl6NhmRPeqgs8qM602chMwV5/gR6evD8WFaFxtv2rKc+uRvg4Cpu8Ql QWR+QEoDIi3XcQOYcnZPhzLk/ZDO8Z1GRLNNjc2JJG+qbm2jukbouKUjGIpMcOjQTYerRq r/ePl3gOplCttiitXsSx8cnSkcsjTf1zm/hpn4IHMUWX5mEJ1iSsjk1gmedRIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792922260; 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=LNvjFSZAmKjyxlsVqzQRCtubBVudc5fNOotjl2c0zTY=; b=f84pi6mdBNb9U4z6TXQcCmz+f2It4wApyq3qt8UZCpAu65wARqLfTzpkroxMUMD249bk0f ejxs2cR5hXiHj35eoBLgzQEo3jatRZt75ow4JlfJzsg1Wdj09yGjJHs4qwXrcGvjZFKu03 G17YNzNi/rgRhJMzlGwm2fdyeUwitoyswzmN9VhRlI8xiOvT8K+ubrsjTAuK7nM+EpzabM LhswpY5cHtc0JyiGntKqsrZzdLdTP86RA/3TQ+lu+Y96VDIXG2nf0+pegPSwAXt/2mjSEy 4jXlBNb1ABBBMBW3sPEUfrjYiJ+R2SNS3GLw2STUbPIJZ4OeU3L4aOszKDZNRw== 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 4jCByD3fLQzhXK for ; Sun, 25 Oct 2026 09:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dd1e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 25 Oct 2026 09:57:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Kubaj Subject: git: 0e9af9fb7288 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 0e9af9fb72884e77de79e37069a162e1563ca86b Auto-Submitted: auto-generated Date: Sun, 25 Oct 2026 09:57:40 +0000 Message-Id: <6addd294.3dd1e.33c51732@gitrepo.freebsd.org> The branch stable/15 has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=0e9af9fb72884e77de79e37069a162e1563ca86b commit 0e9af9fb72884e77de79e37069a162e1563ca86b Author: Piotr Kubaj AuthorDate: 2026-10-15 19:18:16 +0000 Commit: Piotr Kubaj CommitDate: 2026-10-25 09:57:25 +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) --- 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 390181012b92..a248aeeafaf7 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)); + } } /*