[PATCH v2 0/4] linux-user/riscv: add vector state to signal context

Nicholas Piggin posted 4 patches 3 days, 4 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250903081417.338515-1-npiggin@gmail.com
Maintainers: Laurent Vivier <laurent@vivier.eu>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
linux-user/riscv/signal.c                | 197 ++++++++-
linux-user/riscv/vdso-asmoffset.h        |   4 +-
tests/tcg/riscv64/Makefile.target        |   5 +
tests/tcg/riscv64/test-signal-handling.c | 507 +++++++++++++++++++++++
4 files changed, 700 insertions(+), 13 deletions(-)
create mode 100644 tests/tcg/riscv64/test-signal-handling.c
[PATCH v2 0/4] linux-user/riscv: add vector state to signal context
Posted by Nicholas Piggin 3 days, 4 hours ago
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.

The signal handler test has some gross header hacks in it to make
it work for me (debian arm64->riscv64 cross compile environment),
I would not be surprised if it breaks in other environments, any
ideas or breakages let me know. May just have to define the types
by hand for now if it becomes intractable.

I couldn't find much in the way of previous discussion or work on
this, forgive me if I've missed it.

Thanks,
Nick

Nicholas Piggin (4):
  tests/tcg/riscv64: Add a user signal handling test
  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                | 197 ++++++++-
 linux-user/riscv/vdso-asmoffset.h        |   4 +-
 tests/tcg/riscv64/Makefile.target        |   5 +
 tests/tcg/riscv64/test-signal-handling.c | 507 +++++++++++++++++++++++
 4 files changed, 700 insertions(+), 13 deletions(-)
 create mode 100644 tests/tcg/riscv64/test-signal-handling.c

-- 
2.51.0
Re: [PATCH v2 0/4] linux-user/riscv: add vector state to signal context
Posted by Richard Henderson 3 days, 2 hours ago
On 9/3/25 10:14, Nicholas Piggin wrote:
> 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.
> 
> The signal handler test has some gross header hacks in it to make
> it work for me (debian arm64->riscv64 cross compile environment),
> I would not be surprised if it breaks in other environments, any
> ideas or breakages let me know. May just have to define the types
> by hand for now if it becomes intractable.
> 
> I couldn't find much in the way of previous discussion or work on
> this, forgive me if I've missed it.
> 
> Thanks,
> Nick
> 
> Nicholas Piggin (4):
>    tests/tcg/riscv64: Add a user signal handling test
>    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                | 197 ++++++++-
>   linux-user/riscv/vdso-asmoffset.h        |   4 +-
>   tests/tcg/riscv64/Makefile.target        |   5 +
>   tests/tcg/riscv64/test-signal-handling.c | 507 +++++++++++++++++++++++
>   4 files changed, 700 insertions(+), 13 deletions(-)
>   create mode 100644 tests/tcg/riscv64/test-signal-handling.c
> 

Whoops, v2 and my review of v1 passed in flight.
There are a number of errors.

r~