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 <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
David Hildenbrand 2015-12-09 16:36:42 +01:00 committed by Cornelia Huck
parent b3820e6ca0
commit 234779a2b9
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}