summaryrefslogtreecommitdiffstats
path: root/target-s390x/helper.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-12-09 16:36:42 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:29:55 -0600
commitc703b4afe3741da99ec3f648bd94bee6c33f60bc (patch)
tree7fa66ece77fe61c8c187f219124b76fc22dcd83d /target-s390x/helper.c
parentcd283efc7fb48e56fffc207a93288c1ffa21a84e (diff)
downloadhqemu-c703b4afe3741da99ec3f648bd94bee6c33f60bc.zip
hqemu-c703b4afe3741da99ec3f648bd94bee6c33f60bc.tar.gz
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/helper.c')
-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 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;
}
OpenPOWER on IntegriCloud