From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyy4g-0003xB-6y for qemu-devel@nongnu.org; Thu, 22 Mar 2018 07:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyy4f-0001hZ-6x for qemu-devel@nongnu.org; Thu, 22 Mar 2018 07:08:02 -0400 Received: from mail-ot0-x243.google.com ([2607:f8b0:4003:c0f::243]:39270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eyy4f-0001hN-2H for qemu-devel@nongnu.org; Thu, 22 Mar 2018 07:08:01 -0400 Received: by mail-ot0-x243.google.com with SMTP id h8-v6so8981982oti.6 for ; Thu, 22 Mar 2018 04:08:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20180123144807.5618-1-laurent@vivier.eu> <20180123144807.5618-13-laurent@vivier.eu> <758f54da-d733-6e95-57cf-cc8b25a81dd5@vivier.eu> From: Peter Maydell Date: Thu, 22 Mar 2018 11:07:40 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PULL 12/13] page_unprotect(): handle calls to pages that are PAGE_WRITE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: QEMU Developers On 22 March 2018 at 11:05, Peter Maydell wrote: > On 22 March 2018 at 10:36, Laurent Vivier wrote: >> It goes wrong in this part: >> >> + */ >> + if (is_write && info->si_signo == SIGSEGV && info->si_code == >> SEGV_ACCERR && >> + h2g_valid(address)) { >> >> Because, on ppc, si_code is SEGV_MAPERR and not SEGV_ACCERR >> (on x86_64, si_code is SEGV_ACCERR as expected) > > So on PPC if you have a page mapped, and you access it with > the wrong permissions, you get SEGV_MAPERR? This seems like > a host kernel bug to me. ...in particular, kernel commit ecb101aed86156e (dated Dec 2017) fixes a regression introduced in commit c3350602e876 that broke the ppc kernels so they started returning SEGV_MAPERR here instead of SEGV_ACCERR. Presumably your host kernel is missing this fix. thanks -- PMM