|
| From: | Richard Henderson |
| Subject: | Re: [PATCH 06/26] target/mips: Extract load/store helpers to ldst_helper.c |
| Date: | Sun, 18 Apr 2021 12:08:21 -0700 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote:
+static inline hwaddr do_translate_address(CPUMIPSState *env,
+ target_ulong address,
+ MMUAccessType access_type,
+ uintptr_t retaddr)
+{
+ hwaddr paddr;
+ CPUState *cs = env_cpu(env);
+
+ paddr = cpu_mips_translate_address(env, address, access_type);
+
+ if (paddr == -1LL) {
+ cpu_loop_exit_restore(cs, retaddr);
+ } else {
+ return paddr;
+ }
+}
Code motion, so, Reviewed-by: Richard Henderson <richard.henderson@linaro.org>but I think that it's a mistake for cpu_mips_translate_address to split the raise_mmu_exception from the cpu_loop_exit_restore. If you make the changes to env to indicate the exception, you *must* then go back to the main loop.
There seems to be exactly one caller, this one, so it should be trivial to change, which the lets do_translate_address vanish entirely.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |