diff mbox

[Qemu-devel,05/12] KVM/MIPS: In KVM mode, inject IRQ2 (I/O) interupts via ioctls(). COP0 emulation is in-kernel

Message ID 1362237527-23678-7-git-send-email-sanjayl@kymasys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sanjay Lal March 2, 2013, 3:18 p.m. UTC
---
 hw/mips_int.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/hw/mips_int.c b/hw/mips_int.c
index 6423fd0..6c655af 100644
--- a/hw/mips_int.c
+++ b/hw/mips_int.c
@@ -23,6 +23,8 @@ 
 #include "hw.h"
 #include "mips_cpudevs.h"
 #include "cpu.h"
+#include "sysemu/kvm.h"
+#include "kvm_mips.h"
 
 static void cpu_mips_irq_request(void *opaque, int irq, int level)
 {
@@ -33,8 +35,21 @@  static void cpu_mips_irq_request(void *opaque, int irq, int level)
 
     if (level) {
         env->CP0_Cause |= 1 << (irq + CP0Ca_IP);
+
+#ifdef CONFIG_KVM
+        if (kvm_enabled() && irq == 2) {
+            kvm_mips_set_interrupt (env, irq, level);
+        }
+#endif
+
     } else {
         env->CP0_Cause &= ~(1 << (irq + CP0Ca_IP));
+
+#ifdef CONFIG_KVM
+        if (kvm_enabled() && irq == 2) {
+            kvm_mips_set_interrupt (env, irq, level);
+        }
+#endif
     }
 
     if (env->CP0_Cause & CP0Ca_IP_mask) {