From nobody Sun Oct 25 09:57:40 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 4jCByL0lzFz6xqkC for ; Sun, 25 Oct 2026 09:57:46 +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 4jCByK5jQSz4sRY for ; Sun, 25 Oct 2026 09:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792922265; 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=in7J+1VAoZ0JsRT860Emv7/XypaWTtqdT9PtHiRHhXVDlYq356DXh15UmdkBG5kodphZYM 4X9lUOgrf8R5Yfn99E2aG1oEWoOxwQXJbqGC7bRM6Hvf/HltVbrbEuY6oDICYUPtu3ln2f Tf3FLA1Lba31FaGRq8lS75nWzt8w2rPf8iz84wouBdW5QddOsEj7RIQVeofsIpUb/5oGOg F3p3aPRKoNB5Gl2jmnb1wS0lYAJwO8SGFSsTfG+eTh1BAW5Rlivp2qfLv0Z3v9Ba+G6fDg BmVvXcAoP07uLDuOOVB2WTbVFdRv+hy40drykJu/vP+4QSwefWsYMKNtmzEOxA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792922265; b=m/3JaZXC3av2LMKiXAxIKUa3MC7nz7t0DWRWJ/bBX5bkuuGjNJ//5vJQrPLXWrOcSalDgm +tieAzzGlclUBaId6XkWrD4/rXOvzSZc4GA/5sCvpWy68oMz4k2wcIATYkJvBuqxBbD1uu 5KGwXykf6/s3eN/UeoK3qECt6dwdr+aw3z0oW9MRjLopB5bNqAFTqd09sdgxa/tG9wAY9a gRMNUwV1yrOkMRjGqC6c7pV7h+9qfxK3+dwUSI2SycuMh5ADUlnsaKOL3jylCuJzMdeGnW 1D9MJ/A+tl4bGwgKvOcMu/dsf8dMGwunBZsT6IzZ876jVBe7g8iNwIPSa1oo4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792922265; 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=n8kjMTv6jbmrpvoc8JhrEN1AyutV91XLx3XQt3lFDm6alNQLIc/hLTuwF1ZYQsd6lYtbBn Ms2VoONpE1y8oT2G8EfJJlazgFmwyQSiKyEC42nZc40TtT7RQPYf6zv4rVdvObpdpF74P8 W+aSem0KcrX4bDiGG1QJXnwziqFKT0HU+SeADHN8UESJF16J4gh3PkxMIwwDvkQPIMU2CR ljy5Al9lEDakhPm8KO5Qt2MlgCrc0M+oysOJyHZ8jYbB/QyRTmCBAx1qeRYQEYYsDo+Yf6 rLcqIb+3hQZ3aNZhj6M5V6owX2T9TXiqSvh5GA7zrwXu44BoMjZ+HEL8Pfs1LQ== 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 4jCByK5MW7zhxW for ; Sun, 25 Oct 2026 09:57:45 +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-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/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)); + } } /*