[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 06/10] target/arm: optimize indirect branches
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH v3 06/10] target/arm: optimize indirect branches |
Date: |
Wed, 26 Apr 2017 23:20:38 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Apr 26, 2017 at 09:54:07 +0200, Richard Henderson wrote:
> On 04/26/2017 08:23 AM, Emilio G. Cota wrote:
> >+static bool gen_jr;...
> > case DISAS_JUMP:
> >+ if (gen_jr) {
>
> Why the variable? Why not just try the goto_ptr for any DISAS_JUMP?
We have code that assumes DISAS_JUMP implies "go to exec loop", e.g.:
case 6: /* isb */
/* We need to break the TB after this insn to execute
* self-modifying code correctly and also to take
* any pending interrupts immediately.
*/
gen_lookup_tb(s);
where gen_lookup_tb does:
/* Force a TB lookup after an instruction that changes the CPU state. */
static inline void gen_lookup_tb(DisasContext *s)
{
tcg_gen_movi_i32(cpu_R[15], s->pc & ~1);
s->is_jmp = DISAS_JUMP;
}
Also, the gen_exception_* functions set DISAS_JUMP. I suspect we want to go
to the exec loop with those as well.
Testing shows that I'm onto something; if I remove the variable,
and note that I make sure DISAS_UPDATE is not falling through, I get
easily reproducible (~1 out of 5) freezes and other instability
(e.g. RCU lockup warnings) when booting + shutting down debian jessie
in the guest.
In v4 I've added a comment about this.
Thanks,
E.
Re: [Qemu-devel] [PATCH v3 01/10] tcg-runtime: add lookup_tb_ptr helper, Alex Bennée, 2017/04/26
[Qemu-devel] [PATCH v3 06/10] target/arm: optimize indirect branches, Emilio G. Cota, 2017/04/26
[Qemu-devel] [PATCH v3 10/10] tb-hash: improve tb_jmp_cache hash function in user mode, Emilio G. Cota, 2017/04/26