summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-06-22 14:58:23 +0100
committerMax Filippov <jcmvbkbc@gmail.com>2018-06-30 12:00:17 -0700
commit0f02251a30ea8c4ce64d9a240795e10bb3c5852c (patch)
treebe9785d9ef0acd2c19b1269bcee965505d906ed9
parent9c509ff94e58823624b9617590134bc05d674279 (diff)
downloadfocaccia-qemu-0f02251a30ea8c4ce64d9a240795e10bb3c5852c.tar.gz
focaccia-qemu-0f02251a30ea8c4ce64d9a240795e10bb3c5852c.zip
xtensa: Avoid calling get_page_addr_code() from helper function
The xtensa frontend calls get_page_addr_code() from its
itlb_hit_test helper function. This function is really part
of the TCG core's internals, and calling it from a target
helper makes it awkward to make changes to that core code.
It also means that we don't pass the correct retaddr to
tlb_fill(), so we won't correctly handle the case where
an exception is generated.

The helper is used for the instructions IHI, IHU and IPFL.

Change it to call cpu_ldb_code_ra() instead.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target/xtensa/op_helper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c
index bbbbb33f3c..d4c942d879 100644
--- a/target/xtensa/op_helper.c
+++ b/target/xtensa/op_helper.c
@@ -458,7 +458,11 @@ void HELPER(check_interrupts)(CPUXtensaState *env)
 
 void HELPER(itlb_hit_test)(CPUXtensaState *env, uint32_t vaddr)
 {
-    get_page_addr_code(env, vaddr);
+    /*
+     * Attempt the memory load; we don't care about the result but
+     * only the side-effects (ie any MMU or other exception)
+     */
+    cpu_ldub_code_ra(env, vaddr, GETPC());
 }
 
 /*!