aboutsummaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-12-09 16:36:42 +0100
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-01-27 15:34:48 +0100
commit234779a2b9141d9386289ba5ed86c9d617567646 (patch)
treec6d0b32f928900641ac67e9faa5d81c849ad6e72 /target-s390x
parentb3820e6ca0c364cfa73c9bc1614d2f303fc74703 (diff)
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>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/helper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index e541d69724..1231e586a4 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;
}