From: David Hildenbrand <d...@linux.vnet.ibm.com> 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 <borntrae...@de.ibm.com> Signed-off-by: David Hildenbrand <d...@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.h...@de.ibm.com> --- 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