Received: from eggs.gnu.org ([2001:4830:134:3::10]:47744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5YWR-0006Bp-QO for qemu-devel@nongnu.org; Mon, 09 Apr 2018 11:15:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5YWQ-0005b7-27 for qemu-devel@nongnu.org; Mon, 09 Apr 2018 11:15:55 -0400 From: Cornelia Huck Date: Mon, 9 Apr 2018 17:15:32 +0200 Message-Id: <20180409151533.2253-8-cohuck@redhat.com> In-Reply-To: <20180409151533.2253-1-cohuck@redhat.com> References: <20180409151533.2253-1-cohuck@redhat.com> Subject: [Qemu-devel] [PULL for-2.12 7/8] s390x/mmu: don't overwrite pending exception in mmu translate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Christian Borntraeger , Alexander Graf , Richard Henderson , David Hildenbrand , Thomas Huth , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Cornelia Huck From: David Hildenbrand If we already triggered another exception, don't overwrite it with a protection exception. Only applies to old KVM instances without the virtual memory access IOCTL in KVM. Signed-off-by: David Hildenbrand Message-Id: <20180409113019.14568-2-david@redhat.com> Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- target/s390x/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 1deeb6e6e4..a25deef5dd 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -325,7 +325,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr, r = mmu_translate_region(env, vaddr, asc, asce, level, raddr, flags, rw, exc); - if (rw == MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { + if (!r && rw == MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { trigger_prot_fault(env, vaddr, asc, rw, exc); return -1; } -- 2.14.3