From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bV9ap-0007oh-HQ for qemu-devel@nongnu.org; Wed, 03 Aug 2016 23:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bV9an-0000tG-8Z for qemu-devel@nongnu.org; Wed, 03 Aug 2016 23:45:10 -0400 Date: Thu, 4 Aug 2016 12:03:40 +1000 From: David Gibson Message-ID: <20160804020340.GC9189@voom.fritz.box> References: <1470210923.12584.67.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <1470210923.12584.67.camel@kernel.crashing.org> Subject: Re: [Qemu-devel] [PATCH] ppc: Fix catching some segfaults in user mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Anton Blanchard --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Benjamin Herrenschmidt Applied to ppc-for-2.8, thanks. > --- > linux-user/main.c | 1 + > 1 file changed, 1 insertion(+) >=20 > 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 =3D TARGET_SIGSEGV; > info.si_errno =3D 0; > info.si_code =3D TARGET_SEGV_MAPERR; >=20 --=20 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 --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXoqJ8AAoJEGw4ysog2bOSDlwQAL7RklUa4POVfqDB20EzjbN0 nN2dU5eTTeZPLKhiZRRxAQ9ORA9enSmCMHgvosARyF6UU6h0DM/6ZqyQWg6TNbZ8 40f5/vvf5thDSyRP8tay9iaKhNyPhLXI4VG0P357YL5oIpX4lkftKdaZluZg+cfW Yb5yVBmr3m6OAYYU6BiKCUwAVdykc8N0hIg7NuRZRH5JkDjihysl8vXogahWfaKz UrakMe9pSoDVw6RHqg45qcvAJz9knmB7MDqZ2IIn3EEIyzbpK75TxwxNvkuE+kZ3 3FEqR8UU+34Um2xr3PwZzAuf0Z9Oxc5x3JasVmbuGEwpWANHQogtMrbqI/k9P+AQ +MKo2N+ad6KAcgPAsSAuDVhnmNqdne0rwJZWX9f+Bygv6Z2LmecMcAdiUSRB+eHs gfF8o0rrTBCcDrQgK7iASle5tWOQDbsmDaETwsx4cnDszQKkWGGX4lYR7t4g7x7S +KsJpJwa5ZNLmdjz2EMgZog1pWbDFiSuRtGPFuxaIG/jBpiastyToRyOEMiK53y1 FvV1Ayp3h6JDn/0kTx5BeJ3AxXncCAGK6yQHOM+HGFveDoSKqlMttUBOnrdlr5i0 BGkVWWORXr8m6RdEUG0L6xga8WskgZFYCGGgrSn7dyUJxxmXUqas07fM4fIs86LH P02XvZNVBWFdYxg1rRbU =IsAt -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--