From b1475464f7b6387eec1b297ee60dc9912ed661a2 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 3 Jul 2026 15:00:42 +0200 Subject: [PATCH] target/hppa: Delay MMU update until TLB protection bits were set On a 32-bit HPPA CPU, the TLB update for a data translation happens with two consecutive instructions: IDTLBA and IDTLBP. The former sets the target page address, while the second sets the protection bits. There is no need to update the MMU after setting the address bits only, so delay the final update of the MMU until after the execution of the second instruction when the protection bits are known too. Signed-off-by: Helge Deller --- target/hppa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4e34822565..002189ddfb 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2570,7 +2570,7 @@ static bool trans_ixtlbx(DisasContext *ctx, arg_ixtlbx *a) } /* Exit TB for TLB change if mmu is enabled. */ - if (ctx->tb_flags & PSW_C) { + if (ctx->tb_flags & PSW_C && !a->addr) { ctx->base.is_jmp = DISAS_IAQ_N_STALE; } return nullify_end(ctx); @@ -2687,7 +2687,7 @@ static bool trans_ixtlbxf(DisasContext *ctx, arg_ixtlbxf *a) } /* Exit TB for TLB change if mmu is enabled. */ - if (ctx->tb_flags & PSW_C) { + if (ctx->tb_flags & PSW_C && !a->addr) { ctx->base.is_jmp = DISAS_IAQ_N_STALE; } return nullify_end(ctx);