On 2/19/19 12:17 PM, Alex Bennée wrote: > While debugging I came up with this monstrosity: > > if (FIELD_EX32(flags, TBFLAG_ANY, AARCH64_STATE)) { > #ifdef CONFIG_DEBUG_TCG > static uint32_t tb_state = 0; > uint32_t recalc_flags = rebuild_hflags_a64(env, arm_current_el(env)); > tb_state++; > if (flags != recalc_flags) { > fprintf(stderr, "%s: flags %#x, should be %#x (%#x/%d)\n", > __func__, > flags, recalc_flags, flags ^ recalc_flags, tb_state); > abort(); > } > #endif > *pc = env->pc; > flags = FIELD_DP32(flags, TBFLAG_A64, BTYPE, env->btype); > pstate_for_ss = env->pstate; > } else {
I have now included +#ifdef CONFIG_DEBUG_TCG + { + int el = arm_current_el(env); + uint32_t check_flags; + if (is_a64(env)) { + check_flags = rebuild_hflags_a64(env, el); + } else { + check_flags = rebuild_hflags_a32(env, el); + } + g_assert_cmphex(flags, ==, check_flags); + } +#endif r~