linux-user/riscv: Propagate fault address
commit2921343b3df93e4848034ec615c01ee221212c3a
authorGiuseppe Musacchio <thatlemon@gmail.com>
Tue, 1 Oct 2019 16:39:52 +0000 (1 18:39 +0200)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 28 Oct 2019 14:47:27 +0000 (28 07:47 -0700)
tree10146679519bfe9eade69487326f6aa6fb0a2c27
parentc3a28b5d04f3b177befa1235e95e7bb09023f859
linux-user/riscv: Propagate fault address

The CPU loop tagged all the queued signals as QEMU_SI_KILL while it was
filling the `_sigfault` part of `siginfo`: this caused QEMU to copy the
wrong fields over to the userspace program.

Make sure the fault address recorded by the MMU is is stored in the CPU
environment structure.

In case of memory faults store the exception address into `siginfo`.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
linux-user/riscv/cpu_loop.c
target/riscv/cpu_helper.c