From patchwork Sat Mar 2 15:18:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Lal X-Patchwork-Id: 2207181 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AC576DF230 for ; Sat, 2 Mar 2013 15:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752585Ab3CBPTL (ORCPT ); Sat, 2 Mar 2013 10:19:11 -0500 Received: from kymasys.com ([64.62.140.43]:58501 "HELO kymasys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752373Ab3CBPTI (ORCPT ); Sat, 2 Mar 2013 10:19:08 -0500 Received: from agni.kymasys.com ([75.40.23.192]) by kymasys.com for ; Sat, 2 Mar 2013 07:19:06 -0800 Received: by agni.kymasys.com (Postfix, from userid 500) id 04A24630050; Sat, 2 Mar 2013 07:18:50 -0800 (PST) From: Sanjay Lal To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Aurelien Jarno , Gleb Natapov , Marcelo Tosatti , Sanjay Lal Subject: [Qemu-devel][PATCH 05/12] KVM/MIPS: In KVM mode, inject IRQ2 (I/O) interupts via ioctls(). COP0 emulation is in-kernel Date: Sat, 2 Mar 2013 07:18:40 -0800 Message-Id: <1362237527-23678-7-git-send-email-sanjayl@kymasys.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1362237527-23678-1-git-send-email-sanjayl@kymasys.com> References: <1362237527-23678-1-git-send-email-sanjayl@kymasys.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org --- hw/mips_int.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) {