From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOkS4-0005cz-67 for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:09:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOkS1-0000Z8-TC for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:09:24 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:42422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOkS1-0000YX-J7 for qemu-devel@nongnu.org; Thu, 28 Jan 2016 06:09:21 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Jan 2016 11:09:20 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 674F717D8062 for ; Thu, 28 Jan 2016 11:09:27 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0SB9IFs8388902 for ; Thu, 28 Jan 2016 11:09:18 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0SB9Hqu011184 for ; Thu, 28 Jan 2016 04:09:18 -0700 From: Cornelia Huck Date: Thu, 28 Jan 2016 12:09:11 +0100 Message-Id: <1453979351-13089-11-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1453979351-13089-1-git-send-email-cornelia.huck@de.ibm.com> References: <1453979351-13089-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: borntraeger@de.ibm.com, qemu-devel@nongnu.org, agraf@suse.de, David Hildenbrand , jfrei@linux.vnet.ibm.com, Cornelia Huck From: David Hildenbrand If translation fails, we have to return -1. For now, we would simply return the value last stored to raddr (if any). This way, reading invalid memory via gdb will return values, although it shouldn't. Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target-s390x/helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index e541d69..1231e58 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -162,8 +162,9 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) vaddr &= 0x7fffffff; } - mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false); - + if (mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false)) { + return -1; + } return raddr; } -- 2.7.0