From: David Hildenbrand Date: Wed, 9 Dec 2015 15:36:42 +0000 (+0100) Subject: s390x: s390_cpu_get_phys_page_debug has to return -1 X-Git-Tag: v2.6.0-rc0~198^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=234779a2b9141d9386289ba5ed86c9d617567646;p=thirdparty%2Fqemu.git s390x: s390_cpu_get_phys_page_debug has to return -1 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 --- diff --git a/target-s390x/helper.c b/target-s390x/helper.c index e541d697243..1231e586a47 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; }