[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/58] target/arm/cpu: move arm_cpu_kvm_set_irq to kvm.c
From: |
Peter Maydell |
Subject: |
[PULL 16/58] target/arm/cpu: move arm_cpu_kvm_set_irq to kvm.c |
Date: |
Thu, 15 May 2025 11:25:04 +0100 |
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Allow to get rid of CONFIG_KVM in target/arm/cpu.c
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20250512180502.2395029-7-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/kvm_arm.h | 2 ++
target/arm/cpu.c | 31 -------------------------------
target/arm/kvm-stub.c | 5 +++++
target/arm/kvm.c | 29 +++++++++++++++++++++++++++++
4 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index 5bf5d56648f..b638e09a687 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -216,4 +216,6 @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, int
level);
void kvm_arm_enable_mte(Object *cpuobj, Error **errp);
+void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int level);
+
#endif
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 603f08d05a0..66047693415 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1098,37 +1098,6 @@ static void arm_cpu_set_irq(void *opaque, int irq, int
level)
}
}
-static void arm_cpu_kvm_set_irq(void *opaque, int irq, int level)
-{
-#ifdef CONFIG_KVM
- ARMCPU *cpu = opaque;
- CPUARMState *env = &cpu->env;
- CPUState *cs = CPU(cpu);
- uint32_t linestate_bit;
- int irq_id;
-
- switch (irq) {
- case ARM_CPU_IRQ:
- irq_id = KVM_ARM_IRQ_CPU_IRQ;
- linestate_bit = CPU_INTERRUPT_HARD;
- break;
- case ARM_CPU_FIQ:
- irq_id = KVM_ARM_IRQ_CPU_FIQ;
- linestate_bit = CPU_INTERRUPT_FIQ;
- break;
- default:
- g_assert_not_reached();
- }
-
- if (level) {
- env->irq_line_state |= linestate_bit;
- } else {
- env->irq_line_state &= ~linestate_bit;
- }
- kvm_arm_set_irq(cs->cpu_index, KVM_ARM_IRQ_TYPE_CPU, irq_id, !!level);
-#endif
-}
-
static bool arm_cpu_virtio_is_big_endian(CPUState *cs)
{
ARMCPU *cpu = ARM_CPU(cs);
diff --git a/target/arm/kvm-stub.c b/target/arm/kvm-stub.c
index e34d3f5e6b4..4806365cdc5 100644
--- a/target/arm/kvm-stub.c
+++ b/target/arm/kvm-stub.c
@@ -104,3 +104,8 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu)
{
g_assert_not_reached();
}
+
+void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int level)
+{
+ g_assert_not_reached();
+}
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 85911e30242..82668d64385 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -2428,3 +2428,32 @@ void kvm_arm_enable_mte(Object *cpuobj, Error **errp)
cpu->kvm_mte = true;
}
}
+
+void arm_cpu_kvm_set_irq(void *arm_cpu, int irq, int level)
+{
+ ARMCPU *cpu = arm_cpu;
+ CPUARMState *env = &cpu->env;
+ CPUState *cs = CPU(cpu);
+ uint32_t linestate_bit;
+ int irq_id;
+
+ switch (irq) {
+ case ARM_CPU_IRQ:
+ irq_id = KVM_ARM_IRQ_CPU_IRQ;
+ linestate_bit = CPU_INTERRUPT_HARD;
+ break;
+ case ARM_CPU_FIQ:
+ irq_id = KVM_ARM_IRQ_CPU_FIQ;
+ linestate_bit = CPU_INTERRUPT_FIQ;
+ break;
+ default:
+ g_assert_not_reached();
+ }
+
+ if (level) {
+ env->irq_line_state |= linestate_bit;
+ } else {
+ env->irq_line_state &= ~linestate_bit;
+ }
+ kvm_arm_set_irq(cs->cpu_index, KVM_ARM_IRQ_TYPE_CPU, irq_id, !!level);
+}
--
2.43.0
- [PULL 37/58] target/arm/arm-powerctl: compile file once (system), (continued)
- [PULL 37/58] target/arm/arm-powerctl: compile file once (system), Peter Maydell, 2025/05/15
- [PULL 42/58] target/arm/meson: accelerator files are not needed in user mode, Peter Maydell, 2025/05/15
- [PULL 50/58] target/arm/tcg/crypto_helper: compile file once, Peter Maydell, 2025/05/15
- [PULL 53/58] target/arm/tcg/neon_helper: compile file twice (system, user), Peter Maydell, 2025/05/15
- [PULL 46/58] target/arm/machine: move cpu_post_load kvm bits to kvm_arm_cpu_post_load function, Peter Maydell, 2025/05/15
- [PULL 36/58] target/arm/arch_dump: compile file once (system), Peter Maydell, 2025/05/15
- [PULL 40/58] target/arm/ptw: replace TARGET_AARCH64 by CONFIG_ATOMIC64 from arm_casq_ptw, Peter Maydell, 2025/05/15
- [PULL 39/58] target/arm/ptw: replace target_ulong with int64_t, Peter Maydell, 2025/05/15
- [PULL 48/58] target/arm/machine: compile file once (system), Peter Maydell, 2025/05/15
- [PULL 57/58] target/arm/tcg/arith_helper: compile file once, Peter Maydell, 2025/05/15
- [PULL 16/58] target/arm/cpu: move arm_cpu_kvm_set_irq to kvm.c,
Peter Maydell <=
- [PULL 34/58] target/arm/vfp_fpscr: compile file twice (user, system), Peter Maydell, 2025/05/15
- [PULL 33/58] target/arm/helper: compile file twice (user, system), Peter Maydell, 2025/05/15
- [PULL 31/58] target/arm/helper: expose aarch64 cpu registration, Peter Maydell, 2025/05/15
- [PULL 41/58] target/arm/ptw: compile file once (system), Peter Maydell, 2025/05/15
- [PULL 43/58] target/arm/kvm-stub: compile file once (system), Peter Maydell, 2025/05/15
- [PULL 44/58] target/arm/machine: reduce migration include to avoid target specific definitions, Peter Maydell, 2025/05/15
- [PULL 45/58] target/arm/machine: remove TARGET_AARCH64 from migration state, Peter Maydell, 2025/05/15
- [PULL 47/58] target/arm/kvm-stub: add missing stubs, Peter Maydell, 2025/05/15
- [PULL 52/58] target/arm/tcg/iwmmxt_helper: compile file twice (system, user), Peter Maydell, 2025/05/15
- [PULL 51/58] target/arm/tcg/hflags: compile file twice (system, user), Peter Maydell, 2025/05/15