Message ID | 20190311191602.25796-11-svens@stackframe.org |
---|---|
State | New |
Headers | show |
Series | target/hppa patches | expand |
On 3/11/19 12:16 PM, Sven Schnelle wrote: > The current code assumes that we don't need to exit the TB > if a Data Cache Flush or Insert has happend. However, as we > have a shared Data/Instruction TLB, a Data cache flush also > flushes Instruction TLB entries, and a Data cache TLB insert > might also evict a Instruction TLB entry. > > So exit the TB in all cases if Instruction translation is enabled. > > Signed-off-by: Sven Schnelle <svens@stackframe.org> > --- > target/hppa/translate.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) I suppose since we advertise a unified i/d tlb, the os feels that either i/d flush should be sufficient. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/target/hppa/translate.c b/target/hppa/translate.c index a393a12252..fcacff963e 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2474,9 +2474,8 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) gen_helper_itlbp(cpu_env, addr, reg); } - /* Exit TB for ITLB change if mmu is enabled. This *should* not be - the case, since the OS TLB fill handler runs with mmu disabled. */ - if (!a->data && (ctx->tb_flags & PSW_C)) { + /* Exit TB for TLB change if mmu is enabled. */ + if (ctx->tb_flags & PSW_C) { ctx->base.is_jmp = DISAS_IAQ_N_STALE; } return nullify_end(ctx); @@ -2503,7 +2502,7 @@ static bool trans_pxtlbx(DisasContext *ctx, arg_pxtlbx *a) } /* Exit TB for TLB change if mmu is enabled. */ - if (!a->data && (ctx->tb_flags & PSW_C)) { + if (ctx->tb_flags & PSW_C) { ctx->base.is_jmp = DISAS_IAQ_N_STALE; } return nullify_end(ctx);
The current code assumes that we don't need to exit the TB if a Data Cache Flush or Insert has happend. However, as we have a shared Data/Instruction TLB, a Data cache flush also flushes Instruction TLB entries, and a Data cache TLB insert might also evict a Instruction TLB entry. So exit the TB in all cases if Instruction translation is enabled. Signed-off-by: Sven Schnelle <svens@stackframe.org> --- target/hppa/translate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)