Skip to content

OpenRISC floating point context support

Stafford Horne linux-mm lkml openrisc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4openrisc: Properly store r31 to pt_regs on unhandled exceptionsarch/openrisc/kernel/entry.S+2 -40 replies
2/4openrisc: Support storing and restoring fpu statearch/openrisc/include/asm/ptrace.h arch/openrisc/kernel/entry.S arch/openrisc/kernel/traps.c+19 -40 replies
3/4openrisc: Support floating point user apiarch/openrisc/include/uapi/asm/elf.h arch/openrisc/include/uapi/asm/ptrace.h arch/openrisc/include/uapi/asm/sigcontext.h +4 more+41 -66 replies
4/4openrisc: Add floating point regsetarch/openrisc/kernel/ptrace.c+37 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] OpenRISC floating point context support

This series adds support for storing and restoring the OpenRISC floating point context as well as user space API's and regsets.

To support these patches an architecture change had to be made. The OpenRISC fpu status and control register FPCSR is now read/writeable by user space as of architecture spec revision 1.4:

- https://openrisc.io/revisions/r1.4

Previous to this FPCSR reads and writes from user-mode would just be ignored, reads and writes to non permissioned special purpose registers (SPR's) are no-ops.

The patch is split into 3 main parts, the first patch being a cleanup to handling exceptions noticed while working on this.

1. Add support to context saving and switching
2. Add support for SIGFPE and sigcontext
3. Add regset for ptrace register reading/writing

The series has been tested with the glibc test suite and all math tests are passing. Patched projects include:

- GCC - patches upstream to fix issue with resetting exceptions in libgcc
- glibc - https://github.com/stffrdhrn/or1k-glibc/commits/or1k-hard-float
- qemu - https://github.com/stffrdhrn/qemu/commits/or1k-user-fpcsr

I have not worked on binutils-gdb patches yet.

Stafford Horne (4):
openrisc: Properly store r31 to pt_regs on unhandled exceptions
openrisc: Support storing and restoring fpu state
openrisc: Support floating point user api
openrisc: Add floating point regset

 arch/openrisc/include/asm/ptrace.h          |  4 +--
 arch/openrisc/include/uapi/asm/elf.h        |  3 +-
 arch/openrisc/include/uapi/asm/ptrace.h     |  4 +++
 arch/openrisc/include/uapi/asm/sigcontext.h |  1 +
 arch/openrisc/kernel/entry.S                | 31 +++++++++++++----
 arch/openrisc/kernel/head.S                 |  4 +--
 arch/openrisc/kernel/ptrace.c               | 37 +++++++++++++++++++++
 arch/openrisc/kernel/signal.c               |  2 ++
 arch/openrisc/kernel/traps.c                | 27 +++++++++++++--
 9 files changed, 99 insertions(+), 14 deletions(-)
Signature · 1 line
2.39.1