mbox series

[0/2] linux-user/nios2: trap and kuser fixes

Message ID 20210915174951.1852266-1-richard.henderson@linaro.org
Headers show
Series linux-user/nios2: trap and kuser fixes | expand

Message

Richard Henderson Sept. 15, 2021, 5:49 p.m. UTC
Based-on: 20210813131809.28655-1-peter.maydell@linaro.org
("linux-user: Clean up siginfo_t handling for arm, aarch64")
... for force_sig_fault().

Emulation of EXCP_TRAP was really wrong, in that we were using
the contents of R1 when we really wanted the trap immediate.

Emulation of the kuser page was wrong, in that the first word
contains the version, and must be readable.  The easiest way
to fix this is to map real data, but then we have to come up
with some replacement for __kuser_cmpxchg, and the easiest way
to do that is to steal an unused trap number.

Both of these stand in the way of cleaning up SIGSEGV, which
is how the kuser page is currently implemented.

I built a nios2-elf binutils and wrote a couple of asm smoke
tests for this.  So, golden!


r~


Richard Henderson (2):
  linux-user/nios2: Properly emulate EXCP_TRAP
  linux-user/nios2: Map a real kuser page

 target/nios2/cpu.h          |  5 ++-
 linux-user/elfload.c        | 35 +++++++++++++++
 linux-user/nios2/cpu_loop.c | 85 ++++++++++++++++++++-----------------
 target/nios2/translate.c    | 26 +++++++-----
 4 files changed, 99 insertions(+), 52 deletions(-)

-- 
2.25.1

Comments

Richard Henderson Sept. 15, 2021, 5:54 p.m. UTC | #1
On 9/15/21 10:49 AM, Richard Henderson wrote:
> Based-on: 20210813131809.28655-1-peter.maydell@linaro.org

> ("linux-user: Clean up siginfo_t handling for arm, aarch64")

> ... for force_sig_fault().


Laurent, while I posted a follow-up to Peter's patch set, I'd prefer to go ahead and merge 
his first.  Just about everything I'm poking about with currently requires force_sig_fault().


r~
Laurent Vivier Sept. 16, 2021, 3:06 p.m. UTC | #2
Le 15/09/2021 à 19:54, Richard Henderson a écrit :
> On 9/15/21 10:49 AM, Richard Henderson wrote:

>> Based-on: 20210813131809.28655-1-peter.maydell@linaro.org

>> ("linux-user: Clean up siginfo_t handling for arm, aarch64")

>> ... for force_sig_fault().

> 

> Laurent, while I posted a follow-up to Peter's patch set, I'd prefer to go ahead and merge his

> first.  Just about everything I'm poking about with currently requires force_sig_fault().

> 


I'm going to send a PR with the "linux-user: split internals out of qemu.h" series, the Peter's
siginfo series will be in the next one.

Thanks,
Laurent