qemu-devel
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]