On 2/4/23 11:22 AM, Kornel Dulęba wrote:
The branch main has been updated by kd:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6926e2699ae55080f860488895a2a9aa6e6d9b4d

commit 6926e2699ae55080f860488895a2a9aa6e6d9b4d
Author:     Kornel Dulęba <[email protected]>
AuthorDate: 2023-02-04 12:59:30 +0000
Commit:     Kornel Dulęba <[email protected]>
CommitDate: 2023-02-04 19:21:43 +0000

     arm: Add support for using VFP in kernel
Add missing logic to allow in-kernel VFP usage for ARMv7 NEON.
     The implementation is strongly based on arm64 code.
     It introduces a family of fpu_kern_* functions to enable the usage
     of VFP instructions in kernel.
     Apart from that the existing armv7 VFP logic was modified,
     taking into account that the state of the VFP registers can now
     be modified in the kernel.
Co-developed by: Wojciech Macek <[email protected]>
     Sponsored by:   Stormshield
     Obtained from:  Semihalf
     Reviewed by:    andrew
     Differential Revision: https://reviews.freebsd.org/D37419

Note that changing the layout of 'struct fpreg' and what fill_fpregs
and set_fpregs do does change the layout of the .reg2 coredump note
and what happens for PT_[GS]ETFPREGS for ptrace(2).  That said, GDB
at least ignores all that since it is known to be useless.  I haven't
checked LLDB, but it likely doesn't care about the old interfaces
either.  Maybe at least a RELNOTES entry and __FreeBSD_version bump
in case it is problematic in the future?

---
  lib/libthread_db/arch/arm/libpthread_md.c |  21 ++--
  sys/arm/arm/exec_machdep.c                |  49 ++++----
  sys/arm/arm/machdep.c                     |   1 +
  sys/arm/arm/machdep_kdb.c                 |  31 ++++-
  sys/arm/arm/swtch-v6.S                    |   8 +-
  sys/arm/arm/swtch.S                       |   8 +-
  sys/arm/arm/vfp.c                         | 182 +++++++++++++++++++++++++++++-
  sys/arm/arm/vm_machdep.c                  |   6 +-
  sys/arm/include/fpu.h                     |   7 ++
  sys/arm/include/pcb.h                     |   5 +
  sys/arm/include/reg.h                     |  12 +-
  sys/arm/include/vfp.h                     |  17 +++
  12 files changed, 293 insertions(+), 54 deletions(-)

diff --git a/sys/arm/arm/exec_machdep.c b/sys/arm/arm/exec_machdep.c
index 2bf3efff7fe4..c14bd51146ef 100644
--- a/sys/arm/arm/exec_machdep.c
+++ b/sys/arm/arm/exec_machdep.c
@@ -100,16 +100,18 @@ get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp)
        memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg,
-           sizeof(vfp->mcv_reg));
+               sizeof(vfp->mcv_reg));

FYI, this was a style regression here and elsewhere in the commit.

--
John Baldwin


Reply via email to