From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PATCH v2 03/12] target/alpha: Simplify call_pal implementation
Date: Mon, 22 Sep 2025 19:39:07 -0700 [thread overview]
Message-ID: <20250923023922.3102471-4-richard.henderson@linaro.org> (raw)
In-Reply-To: <20250923023922.3102471-1-richard.henderson@linaro.org>
Since 288a5fe980f, we don't link translation blocks
directly to palcode entry points. If we load palbr
from env instead of encoding the constant, we avoid
all need for tb_flush().
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/alpha/helper.h | 1 -
target/alpha/sys_helper.c | 6 ------
target/alpha/translate.c | 21 ++++++---------------
3 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/target/alpha/helper.h b/target/alpha/helper.h
index d60f208703..788d2fbf28 100644
--- a/target/alpha/helper.h
+++ b/target/alpha/helper.h
@@ -90,7 +90,6 @@ DEF_HELPER_FLAGS_2(ieee_input_s, TCG_CALL_NO_WG, void, env, i64)
#if !defined (CONFIG_USER_ONLY)
DEF_HELPER_FLAGS_1(tbia, TCG_CALL_NO_RWG, void, env)
DEF_HELPER_FLAGS_2(tbis, TCG_CALL_NO_RWG, void, env, i64)
-DEF_HELPER_FLAGS_1(tb_flush, TCG_CALL_NO_RWG, void, env)
DEF_HELPER_1(halt, void, i64)
diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c
index 51e3254428..87e37605c1 100644
--- a/target/alpha/sys_helper.c
+++ b/target/alpha/sys_helper.c
@@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/cputlb.h"
-#include "exec/tb-flush.h"
#include "exec/helper-proto.h"
#include "system/runstate.h"
#include "system/system.h"
@@ -38,11 +37,6 @@ void helper_tbis(CPUAlphaState *env, uint64_t p)
tlb_flush_page(env_cpu(env), p);
}
-void helper_tb_flush(CPUAlphaState *env)
-{
- tb_flush(env_cpu(env));
-}
-
void helper_halt(uint64_t restart)
{
if (restart) {
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index cebab0318c..f11b382438 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -48,8 +48,6 @@ struct DisasContext {
#ifdef CONFIG_USER_ONLY
MemOp unalign;
-#else
- uint64_t palbr;
#endif
uint32_t tbflags;
int mem_idx;
@@ -1155,7 +1153,6 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode)
#else
{
TCGv tmp = tcg_temp_new();
- uint64_t entry;
gen_pc_disp(ctx, tmp, 0);
if (ctx->tbflags & ENV_FLAG_PAL_MODE) {
@@ -1165,12 +1162,11 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode)
}
tcg_gen_st_i64(tmp, tcg_env, offsetof(CPUAlphaState, exc_addr));
- entry = ctx->palbr;
- entry += (palcode & 0x80
- ? 0x2000 + (palcode - 0x80) * 64
- : 0x1000 + palcode * 64);
-
- tcg_gen_movi_i64(cpu_pc, entry);
+ tcg_gen_ld_i64(cpu_pc, tcg_env, offsetof(CPUAlphaState, palbr));
+ tcg_gen_addi_i64(cpu_pc, cpu_pc,
+ palcode & 0x80
+ ? 0x2000 + (palcode - 0x80) * 64
+ : 0x1000 + palcode * 64);
return DISAS_PC_UPDATED;
}
#endif
@@ -1292,11 +1288,7 @@ static DisasJumpType gen_mtpr(DisasContext *ctx, TCGv vb, int regno)
case 7:
/* PALBR */
tcg_gen_st_i64(vb, tcg_env, offsetof(CPUAlphaState, palbr));
- /* Changing the PAL base register implies un-chaining all of the TBs
- that ended with a CALL_PAL. Since the base register usually only
- changes during boot, flushing everything works well. */
- gen_helper_tb_flush(tcg_env);
- return DISAS_PC_STALE;
+ break;
case 32 ... 39:
/* Accessing the "non-shadow" general registers. */
@@ -2874,7 +2866,6 @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
ctx->ir = cpu_std_ir;
ctx->unalign = (ctx->tbflags & TB_FLAG_UNALIGN ? MO_UNALN : MO_ALIGN);
#else
- ctx->palbr = env->palbr;
ctx->ir = (ctx->tbflags & ENV_FLAG_PAL_MODE ? cpu_pal_ir : cpu_std_ir);
#endif
--
2.43.0
next prev parent reply other threads:[~2025-09-23 2:43 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 2:39 [PATCH v2 00/12] accel/tcg: Improve tb_flush usage Richard Henderson
2025-09-23 2:39 ` [PATCH v2 01/12] gdbstub: Remove tb_flush uses Richard Henderson
2025-09-23 9:11 ` Philippe Mathieu-Daudé
2025-09-23 16:23 ` Richard Henderson
2025-09-23 2:39 ` [PATCH v2 02/12] accel/tcg: Split out tb_flush__exclusive Richard Henderson
2025-09-23 7:17 ` Philippe Mathieu-Daudé
2025-09-23 9:16 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` Richard Henderson [this message]
2025-09-23 7:30 ` [PATCH v2 03/12] target/alpha: Simplify call_pal implementation Philippe Mathieu-Daudé
2025-09-23 9:05 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 04/12] target/riscv: Record misa_ext in TCGTBCPUState.cs_base Richard Henderson
2025-09-24 6:17 ` LIU Zhiwei
2025-09-24 12:23 ` Daniel Henrique Barboza
2025-09-28 23:10 ` Alistair Francis
2025-09-23 2:39 ` [PATCH v2 05/12] accel/tcg: Move post-load tb_flush to vm_change_state hook Richard Henderson
2025-09-23 7:22 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 06/12] hw/ppc/spapr: Use tb_invalidate_phys_range in h_page_init Richard Henderson
2025-09-23 4:49 ` Harsh Prateek Bora
2025-09-23 8:55 ` Philippe Mathieu-Daudé
2025-09-23 9:45 ` Harsh Prateek Bora
2025-09-23 16:59 ` Richard Henderson
2025-09-23 2:39 ` [PATCH v2 07/12] linux-user: Use tb_flush_exclusive to start second thread Richard Henderson
2025-09-23 8:50 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 08/12] plugins: Use tb_flush__exclusive Richard Henderson
2025-09-23 7:33 ` Philippe Mathieu-Daudé
2025-09-23 13:35 ` Philippe Mathieu-Daudé
2025-09-23 20:28 ` Richard Henderson
2025-09-24 3:18 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 09/12] accel/tcg: Introduce EXCP_TB_FLUSH Richard Henderson
2025-09-23 7:10 ` Paolo Bonzini
2025-09-23 20:02 ` Richard Henderson
2025-09-23 2:39 ` [PATCH v2 10/12] accel/tcg: Use EXCP_TB_FLUSH in tb_gen_code Richard Henderson
2025-09-23 9:15 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 11/12] accel/tcg: Remove tb_flush Richard Henderson
2025-09-23 7:24 ` Philippe Mathieu-Daudé
2025-09-23 2:39 ` [PATCH v2 12/12] accel/tcg: Tighten assert in tb_flush__exclusive Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250923023922.3102471-4-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).