Sync PC for mem ldst on aarch64

This commit is contained in:
mio
2022-10-20 21:19:18 +02:00
parent 35010035d7
commit a5d4d30a31
2 changed files with 48 additions and 0 deletions

View File

@@ -3845,6 +3845,12 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn)
/* Loads and stores */
static void disas_ldst(DisasContext *s, uint32_t insn)
{
if (HOOK_EXISTS(s->uc, UC_HOOK_MEM_READ) || HOOK_EXISTS(s->uc, UC_HOOK_MEM_WRITE)) {
// sync PC if there are memory hooks.
// TODO: Better granularity by checking ldst type and corresponding hook type
gen_a64_set_pc_im(s->uc->tcg_ctx, s->pc_curr);
}
switch (extract32(insn, 24, 6)) {
case 0x08: /* Load/store exclusive */
disas_ldst_excl(s, insn);