From nobody Sun Oct 25 10:16:31 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 4jCCN45LG2z6xryH for ; Sun, 25 Oct 2026 10:16:36 +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 4jCCN43SnZz3C83 for ; Sun, 25 Oct 2026 10:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792923396; 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=mzUTdxiqx20emaaOxU2r5dSzTHrLHtUyM0Dn2/PqbW4u07aImIK0Zs2Q/K0i6l75+IFS9O EwLxph4nRM9GNCsl7bn4agQFthIK2DC3pS8/O+s61fkNJwL7YSB+h5ugl4d5lW9RXGkbHL q3fUHhvGPUIqKcyI2KXRy0eORUtmd2JcpW+lW8D0gdJMGkX8dmNASvBH7LkESgkKypi+Sf z4aM//MB7VuZnMys3dAQ646F91oILFviKVYwUgfDaoUvZw8pPrrfPhO8Kvo9LNXB6Brp60 i8zJHiHc4E7U4pwjPadewVshc13bnzZQSxq4vLBza+Xow1+lvc952I2oYNggHg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792923396; b=YjQ9SGD0zhdTVSztIWPXkX70oPUwWU4rAMCDaB5xE/4PwBh0slTcXLwBOjxviMosCxSJHF B4Z/5HfQOZToAPesS2Ch637eEsUMsctN9B2sivBz+PWbQqE5T8fjC6WHzkn3Is0qRrPYKp Omo1/oBN9oDoPhUmoRNpJ9gE3qPSQlDc/ZOpi5IjddelStLEnBu6SaOgzKBg/em4KxnPxN Tu1uzGO0qCpqTIKpA1+IElIJJvvucCtwrzL3d4yN4D2u14elwBi+XicqqanL2zDZ4cngJP T0jWbCtUNeBDgEEVTIiWhUssleV76XnLVJBHFP9Lewyj/Vd9M8ZF03Bg9h09uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792923396; 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=HtrlAqjC0zSlNjQoKMzb1wnaAZGp4jvxl0k9Q96FWEZDS5iidlsjvEmFlktiZ7g8tzp4AF IRKxg4q2OSn0fX5JGbOnWDb/ch8Qp5sZKzBam+ojy9D0Homt8Hf2Yyg6cvUg3jURg3zSCe sKx6mRI1C/Oa2piroiv8M9n46c2dQeiaBjdPVRVPo271Tv19PPFeqEjXCHUKGVd0CvpR75 1VjsVmYYl5RT1biSubTsfRuVjaN3QmQlOB3aXL4PLauu0yJI0xpOOCKR8GDiO0t7au4H2A 0kszFrdn4KK4I7vgLU3f21hjAWCF5sSlNLRgPVUIPWMoMVftDHYrP7XNfowToQ== 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 4jCCN4375mzjj4 for ; Sun, 25 Oct 2026 10:16:36 +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-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/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)); + } } /*