From nobody Thu Oct 19 23:05:34 2023 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 4SBNby3VRGz4y01c; Thu, 19 Oct 2023 23:05:34 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SBNby2cT7z4YpY; Thu, 19 Oct 2023 23:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697756734; 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=CuPnctkwi/UWzFMHH5LBFCckO5XVGORb6fTA6iDkRi8=; b=wM5Qdd3aITrU9bTwHhMG5Np0f84/GqmR2HJMRlqMf5MO4DiXIjXaMlZ5UKAEbajN0I9nlE 1OuCdBSuyQuwBBlDhBXw9VEnoRmuxy5hjY9uRDnPIh/voijoCK+p/cp+B+IiScQBIHwq3h WA5zNtZyrWey1VRj3E8MmiLqf1K6i3TH2JEnnAkocbJuwXLmG4+1DNeCRYw1Ogs/yGT/ob jgicSC2uClejt26DTEoTEvRtweW38tm4mTunBY2pGfCf7wEVpIbfNkEyZULafvFxJL5vnv T0aDnfCz0U8oV/L78SpAaKD4jYcLDwX1SOyqr7Q8UA5+2rsSAbI+UmGdEFb9ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697756734; a=rsa-sha256; cv=none; b=nUUl0CIp9IqUxF/FB/dKt9aoDObIkanIYIo0t+/nm0SwhXzYV6CD6MfTM/GvehCPY5Yig0 OfSV1cZZwRbvSaPmA3yQA15NbZ7m2bCt1v1YX2ecDb14s4kCRJHVvYKq47ueRO/cq24ONf YhJN8EnYGUDr5ybHcJT5zn+WyE+8C6F5MDOhB2rjMLh/UpY5zy6POv3LXmmx+pYVGOnnVI OhdvoNByd9RcbXwBd6UbZ8BBKWEu9EM6ZMg5i1vbTadl3tLjEthcMWgKBIzLBWDaoB0X/S IWAcA7Z/1gfV1mhATWvjDHGsOQkxuodwt/EfoceyzsZFXr6ubNSt1sQz9DLCTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697756734; 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=CuPnctkwi/UWzFMHH5LBFCckO5XVGORb6fTA6iDkRi8=; b=rvRZyx4heIgPM9nMgy8Hef33gA4s+yOEBmdut2gEWkKYwWvJLa9PNKonJpXkkODKA6fLsP Rb1F9z4GKt4UzKAMvn+xnRr8+NLkmj9wXBZjB3R9oIv+A++H3KcRtiOw9toH53+8KYiGbd bVsPe2Dgr9gubESEqwdqR+BptNNJz3oLu8396PFA0mbj0bbof4LyR87I5+hYAty1/B3obk o35pbpRsXxMNKzmQSOCA71DcZHpgS8jqx7XyVyPZnmtqTXSWgZqFC76reiQYl3LwSFhbv4 nS18FxfjTBMgRCmALPkXLaZl4Y16krfdnDPB8oygk4IUG1MXDXkyNa1lxouBaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SBNby1gpQz17gH; Thu, 19 Oct 2023 23:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39JN5YAT044820; Thu, 19 Oct 2023 23:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39JN5YcO044817; Thu, 19 Oct 2023 23:05:34 GMT (envelope-from git) Date: Thu, 19 Oct 2023 23:05:34 GMT Message-Id: <202310192305.39JN5YcO044817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Houchard Subject: git: 51be8675416d - stable/13 - arm64/compat32: Fix handling of 32bits FP registers. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cognet X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51be8675416df4aa066e823fec37ea6667494e63 Auto-Submitted: auto-generated The branch stable/13 has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=51be8675416df4aa066e823fec37ea6667494e63 commit 51be8675416df4aa066e823fec37ea6667494e63 Author: Olivier Houchard AuthorDate: 2023-10-16 20:18:24 +0000 Commit: Olivier Houchard CommitDate: 2023-10-19 23:05:26 +0000 arm64/compat32: Fix handling of 32bits FP registers. We must consider the aarch32 FP registers as 16 128bits registers, and store that as the first 16 aarch64 FP registers. PR: 267788 (cherry picked from commit ccd0f34d8585cba727dd17a381309855af655b82) (cherry picked from commit 0e0a03c792542a2509702378559622efafc86548) --- sys/arm64/arm64/freebsd32_machdep.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/freebsd32_machdep.c b/sys/arm64/arm64/freebsd32_machdep.c index 731ce8e6d4be..00c9878deb7c 100644 --- a/sys/arm64/arm64/freebsd32_machdep.c +++ b/sys/arm64/arm64/freebsd32_machdep.c @@ -142,8 +142,12 @@ get_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) ("Called get_fpcontext32 while the kernel is using the VFP")); KASSERT((pcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Non-userspace FPU flags set in get_fpcontext32")); - for (i = 0; i < 32; i++) - mcp->mcv_reg[i] = (uint64_t)pcb->pcb_fpustate.vfp_regs[i]; + for (i = 0; i < 16; i++) { + uint64_t *tmpreg = (uint64_t *)&pcb->pcb_fpustate.vfp_regs[i]; + + mcp->mcv_reg[i * 2] = tmpreg[0]; + mcp->mcv_reg[i * 2 + 1] = tmpreg[1]; + } mcp->mcv_fpscr = VFP_FPSCR_FROM_SRCR(pcb->pcb_fpustate.vfp_fpcr, pcb->pcb_fpustate.vfp_fpsr); } @@ -159,8 +163,12 @@ set_fpcontext32(struct thread *td, mcontext32_vfp_t *mcp) pcb = td->td_pcb; if (td == curthread) vfp_discard(td); - for (i = 0; i < 32; i++) - pcb->pcb_fpustate.vfp_regs[i] = mcp->mcv_reg[i]; + for (i = 0; i < 16; i++) { + uint64_t *tmpreg = (uint64_t *)&pcb->pcb_fpustate.vfp_regs[i]; + + tmpreg[0] = mcp->mcv_reg[i * 2]; + tmpreg[1] = mcp->mcv_reg[i * 2 + 1]; + } pcb->pcb_fpustate.vfp_fpsr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); pcb->pcb_fpustate.vfp_fpcr = VFP_FPSR_FROM_FPSCR(mcp->mcv_fpscr); critical_exit();