[PATCH 1/3] target/arm: Drop stub for define_tlb_insn_regs

Richard Henderson posted 3 patches 5 months, 2 weeks ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>
[PATCH 1/3] target/arm: Drop stub for define_tlb_insn_regs
Posted by Richard Henderson 5 months, 2 weeks ago
Allow the call to be compiled out by protecting it
with tcg_enabled.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/helper.c    | 4 +++-
 target/arm/tcg-stubs.c | 5 -----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index c311d2df21..be84954360 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -7767,7 +7767,9 @@ void register_cp_regs_for_features(ARMCPU *cpu)
     }
 
 #ifndef CONFIG_USER_ONLY
-    define_tlb_insn_regs(cpu);
+    if (tcg_enabled()) {
+        define_tlb_insn_regs(cpu);
+    }
 #endif
 
     if (arm_feature(env, ARM_FEATURE_V6)) {
diff --git a/target/arm/tcg-stubs.c b/target/arm/tcg-stubs.c
index 5e5166c049..aac99b2672 100644
--- a/target/arm/tcg-stubs.c
+++ b/target/arm/tcg-stubs.c
@@ -22,11 +22,6 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,
     g_assert_not_reached();
 }
 
-/* TLBI insns are only used by TCG, so we don't need to do anything for KVM */
-void define_tlb_insn_regs(ARMCPU *cpu)
-{
-}
-
 /* With KVM, we never use float_status, so these can be no-ops */
 void arm_set_default_fp_behaviours(float_status *s)
 {
-- 
2.43.0
Re: [PATCH 1/3] target/arm: Drop stub for define_tlb_insn_regs
Posted by Philippe Mathieu-Daudé 5 months, 2 weeks ago
On 7/7/25 17:15, Richard Henderson wrote:
> Allow the call to be compiled out by protecting it
> with tcg_enabled.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/arm/helper.c    | 4 +++-
>   target/arm/tcg-stubs.c | 5 -----
>   2 files changed, 3 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>