[PATCH 02/16] qemu-kvm: Drop kvm_inject_interrupt

Jan Kiszka
2011-05-13T12:14:15Z

Not required, do_inject_nmi runs under the global mutex and can
therefore safely invoke cpu_interrupt (like in upstream).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
monitor.c | 5 +----
qemu-kvm.c | 10 ----------
qemu-kvm.h | 1 -
3 files changed, 1 insertions(+), 15 deletions(-)

diff --git a/monitor.c b/monitor.c
index a9c2850..3abc7e1 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2572,10 +2572,7 @@ static void do_inject_nmi(Monitor *mon, const QDict *qdict)

for (env = first_cpu; env != NULL; env = env->next_cpu)
if (env->cpu_index == cpu_index) {
- if (kvm_enabled())
- kvm_inject_interrupt(env, CPU_INTERRUPT_NMI);
- else
- cpu_interrupt(env, CPU_INTERRUPT_NMI);
+ cpu_interrupt(env, CPU_INTERRUPT_NMI);
break;
}
}
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 628653b..1f9ddea 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -931,16 +931,6 @@ void on_vcpu(CPUState *env, void (*func)(void *data), void *data)
}
}

-static void inject_interrupt(void *data)
-{
- cpu_interrupt(current_env, (long) data);
-}
-
-void kvm_inject_interrupt(CPUState *env, int mask)
-{
- on_vcpu(env, inject_interrupt, (void *) (long) mask);
-}
-
void kvm_update_interrupt_request(CPUState *env)
{
int signal = 0;
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 8b3ce9c..bf03be8 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -407,7 +407,6 @@ void kvm_hpet_enable_kpit(void);
void kvm_hpet_disable_kpit(void);

void on_vcpu(CPUState *env, void (*func)(void *data), void *data);
-void kvm_inject_interrupt(CPUState *env, int mask);
void kvm_update_interrupt_request(CPUState *env);

int kvm_arch_has_work(CPUState *env);
--
1.7.1