[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/4] target/arm: Rely on hflags correct in cpu_g
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 4/4] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state |
Date: |
Tue, 19 Feb 2019 14:40:32 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
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~
- Re: [Qemu-devel] [PATCH 3/4] target/arm: Assert hflags is correct in cpu_get_tb_cpu_state, (continued)
- [Qemu-devel] [PATCH 2/4] target/arm: Rebuild hflags at el changes and MSR writes, Richard Henderson, 2019/02/13
- [Qemu-devel] [PATCH 1/4] target/arm: Split out recompute_hflags et al, Richard Henderson, 2019/02/13
- [Qemu-devel] [PATCH 4/4] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state, Richard Henderson, 2019/02/13
- Re: [Qemu-devel] [PATCH 0/4] target/arm: Reduce overhead of cpu_get_tb_cpu_state, Laurent Desnogues, 2019/02/14
- Re: [Qemu-devel] [PATCH 0/4] target/arm: Reduce overhead of cpu_get_tb_cpu_state, Alex Bennée, 2019/02/14
- Re: [Qemu-devel] [PATCH 0/4] target/arm: Reduce overhead of cpu_get_tb_cpu_state, Emilio G. Cota, 2019/02/14