diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2015-02-12 18:09:22 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-02-18 09:37:14 +0100 |
commit | e3e09d87c6e69c2da684d5aacabe3124ebcb6f8e (patch) | |
tree | 6cc5377c3394de2df9a71fb3f98a12b29a0a2c9a /target-s390x/helper.c | |
parent | 5d180439d07774c5a2477cf9901c9b51c9edd74b (diff) | |
download | qemu-e3e09d87c6e69c2da684d5aacabe3124ebcb6f8e.zip qemu-e3e09d87c6e69c2da684d5aacabe3124ebcb6f8e.tar.gz qemu-e3e09d87c6e69c2da684d5aacabe3124ebcb6f8e.tar.bz2 |
s390x/mmu: Skip exceptions properly when translating addresses for debug
When a fault occurs during the MMU lookup in s390_cpu_get_phys_page_debug(),
the trigger_page_fault() function writes the translation exception code
into the lowcore - something you would not expect during a memory access
by the debugger. Ease this problem by adding an additional parameter to
mmu_translate() which can be used to specify whether a program check and
the translation exception code should be injected or not.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x/helper.c')
-rw-r--r-- | target-s390x/helper.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 76b4b36..f8a3c5a 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -127,7 +127,7 @@ int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, vaddr &= 0x7fffffff; } - if (mmu_translate(env, vaddr, rw, asc, &raddr, &prot)) { + if (mmu_translate(env, vaddr, rw, asc, &raddr, &prot, true)) { /* Translation ended in exception */ return 1; } @@ -154,8 +154,7 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; target_ulong raddr; - int prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; - int old_exc = cs->exception_index; + int prot; uint64_t asc = env->psw.mask & PSW_MASK_ASC; /* 31-Bit mode */ @@ -163,8 +162,7 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) vaddr &= 0x7fffffff; } - mmu_translate(env, vaddr, 2, asc, &raddr, &prot); - cs->exception_index = old_exc; + mmu_translate(env, vaddr, 2, asc, &raddr, &prot, false); return raddr; } |