In order to simplify the next commit, move the
trigger_access_exception() call after the address_space_rw()
calls. No logical change intended.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <
20251008141410.99865-2-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
pages = g_malloc(nr_pages * sizeof(*pages));
ret = translate_pages(cpu, laddr, nr_pages, pages, is_write, &tec);
- if (ret) {
- trigger_access_exception(&cpu->env, ret, tec);
- } else if (hostbuf != NULL) {
+ if (ret == 0 && hostbuf != NULL) {
AddressSpace *as = CPU(cpu)->as;
/* Copy data by stepping through the area page by page */
len -= currlen;
}
}
+ if (ret) {
+ trigger_access_exception(&cpu->env, ret, tec);
+ }
g_free(pages);
return ret;