Skip to content

linux-user/riscv: add vector state to signal context

Nicholas Piggin qemu-devel qemu-riscv 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 13 repliesIn review
  2. v24 patches 4 repliesSuperseded
  3. v14 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Fixed up a bunch of good review comments that Richard made against
the v1 series here https://lore.kernel.org/all/[email protected]/#r
in particular:
- Restoring vl/vtype state using CPU accessors rather than stuffing the
values into the registers directly.
- Fix ABI types.
- Fix some confusion with host/guest pointer mapping.
- Fix error handling to SIGSEGV.
- Style fixes.
- Fixed build issue without riscv intrinsics header.
- Add some more test cases.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5tests/tcg/riscv64: Add a user signal handling testtests/tcg/riscv64/Makefile.target tests/tcg/riscv64/test-signal-handling.c+308 -01 reply
2/5linux-user/riscv: Allow restore_sigcontext to return errorlinux-user/riscv/signal.c+9 -41 reply
3/5linux-user/riscv: Add extended state to sigcontextlinux-user/riscv/signal.c linux-user/riscv/vdso-asmoffset.h+85 -121 reply
4/5linux-user/riscv: Add vector state to signal contextlinux-user/riscv/signal.c target/riscv/cpu.h target/riscv/csr.c +1 more+191 -141 reply
5/5tests/tcg/riscv64: Add vector state to signal testtests/tcg/riscv64/Makefile.target tests/tcg/riscv64/test-signal-handling.c+222 -81 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAlistair Francis
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] linux-user/riscv: add vector state to signal context

Changes in v3:
- Fixed up a bunch of good review comments that Richard made against
the v1 series here https://lore.kernel.org/all/[email protected]/#r
in particular:
- Restoring vl/vtype state using CPU accessors rather than stuffing the
values into the registers directly.
- Fix ABI types.
- Fix some confusion with host/guest pointer mapping.
- Fix error handling to SIGSEGV.
- Style fixes.
- Fixed build issue without riscv intrinsics header.
- Add some more test cases.

Changes in v2:
- Fix 32-bit compile
- Moved sizeof_rt_sigframe change to its correct patch (patch 2 is the one that extends the size of rt_sigframe, patch 3 is adding new extended state to the frame which is added dynamically).

This series adds vector state to the linux-user signal handler, and adds a basic signal handling test case. As a sanity check, I also verified the signal handling test works in the same way when run under a real Linux kernel.

Thanks,
Nick

Nicholas Piggin (5):
tests/tcg/riscv64: Add a user signal handling test linux-user/riscv: Allow restore_sigcontext to return error linux-user/riscv: Add extended state to sigcontext linux-user/riscv: Add vector state to signal context tests/tcg/riscv64: Add vector state to signal test

 linux-user/riscv/signal.c                | 281 +++++++++++-
 linux-user/riscv/vdso-asmoffset.h        |   4 +-
 target/riscv/cpu.h                       |   4 +
 target/riscv/csr.c                       |   7 +-
 target/riscv/vector_helper.c             |  19 +-
 tests/tcg/riscv64/Makefile.target        |   5 +
 tests/tcg/riscv64/test-signal-handling.c | 517 +++++++++++++++++++++++
 7 files changed, 807 insertions(+), 30 deletions(-)
 create mode 100644 tests/tcg/riscv64/test-signal-handling.c
Signature · 1 line
2.51.0