From dd62e6071c27c720a3c2e2fe0e370bd718ccaef3 Mon Sep 17 00:00:00 2001 From: Theodore Dubois Date: Fri, 1 Nov 2024 23:21:39 -0700 Subject: [PATCH] Restore pc before calling into tlb fill hook In my application it is important to have correct pc values available from this hook. --- qemu/softmmu/unicorn_vtlb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu/softmmu/unicorn_vtlb.c b/qemu/softmmu/unicorn_vtlb.c index 8b4e9e0b29..25c684064f 100644 --- a/qemu/softmmu/unicorn_vtlb.c +++ b/qemu/softmmu/unicorn_vtlb.c @@ -55,6 +55,8 @@ bool unicorn_fill_tlb(CPUState *cs, vaddr address, int size, struct hook *hook; HOOK_FOREACH_VAR_DECLARE; + cpu_restore_state(cs, retaddr, false); + HOOK_FOREACH(uc, hook, UC_HOOK_TLB_FILL) { if (hook->to_delete) { continue;