qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc: Fix catching some segfaults in user mode
@ 2016-08-03  7:55 Benjamin Herrenschmidt
  2016-08-04  2:03 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-03  7:55 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel, david, Anton Blanchard

The usermode "translate" code generates an error code value that
has the "is_write" bit set, which causes our switch/case to miss
and display "Invalid segfault errno" and a spurrious second state
dump. Fix it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 linux-user/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/main.c b/linux-user/main.c
index 24f34e6..eb9975c 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1656,6 +1656,7 @@ void cpu_loop(CPUPPCState *env)
             /* XXX: check this. Seems bugged */
             switch (env->error_code & 0xFF000000) {
             case 0x40000000:
+            case 0x42000000:
                 info.si_signo = TARGET_SIGSEGV;
                 info.si_errno = 0;
                 info.si_code = TARGET_SEGV_MAPERR;

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

end of thread, other threads:[~2016-08-04  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03  7:55 [Qemu-devel] [PATCH] ppc: Fix catching some segfaults in user mode Benjamin Herrenschmidt
2016-08-04  2:03 ` David Gibson

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).