* [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
* Re: [Qemu-devel] [PATCH] ppc: Fix catching some segfaults in user mode
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
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2016-08-04 2:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: qemu-ppc, qemu-devel, Anton Blanchard
[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]
On Wed, Aug 03, 2016 at 05:55:23PM +1000, Benjamin Herrenschmidt wrote:
> 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>
Applied to ppc-for-2.8, thanks.
> ---
> 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;
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [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).