qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] linux-user/nios2: trap and kuser fixes
@ 2021-09-15 17:49 Richard Henderson
  2021-09-15 17:49 ` [PATCH 1/2] linux-user/nios2: Properly emulate EXCP_TRAP Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Richard Henderson @ 2021-09-15 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: marex, crwulff, laurent

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-16 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-15 17:49 [PATCH 0/2] linux-user/nios2: trap and kuser fixes Richard Henderson
2021-09-15 17:49 ` [PATCH 1/2] linux-user/nios2: Properly emulate EXCP_TRAP Richard Henderson
2021-09-15 17:49 ` [PATCH 2/2] linux-user/nios2: Map a real kuser page Richard Henderson
2021-09-15 17:54 ` [PATCH 0/2] linux-user/nios2: trap and kuser fixes Richard Henderson
2021-09-16 15:06   ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).