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: 224508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C8E2C2C030F for ; Sun, 3 Mar 2013 03:29:43 +1100 (EST) Received: from localhost ([::1]:38889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBpJd-0001pc-Tk for incoming@patchwork.ozlabs.org; Sat, 02 Mar 2013 11:29:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBpJD-0001jB-R5 for qemu-devel@nongnu.org; Sat, 02 Mar 2013 11:29:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBpJB-0002Na-Ba for qemu-devel@nongnu.org; Sat, 02 Mar 2013 11:29:15 -0500 Received: from kymasys.com ([64.62.140.43]:43117) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1UBpJB-0002NR-3Z for qemu-devel@nongnu.org; Sat, 02 Mar 2013 11:29:13 -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 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> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 64.62.140.43 Cc: Sanjay Lal , Gleb Natapov , Marcelo Tosatti , Aurelien Jarno , kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 05/12] KVM/MIPS: In KVM mode, inject IRQ2 (I/O) interupts via ioctls(). COP0 emulation is in-kernel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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) {