From patchwork Mon May 2 18:32:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 93692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 611E6B6F59 for ; Tue, 3 May 2011 04:34:31 +1000 (EST) Received: from localhost ([::1]:33314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGxwx-0000G4-8r for incoming@patchwork.ozlabs.org; Mon, 02 May 2011 14:34:27 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGxwT-00009V-EW for qemu-devel@nongnu.org; Mon, 02 May 2011 14:33:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QGxwR-00058A-H7 for qemu-devel@nongnu.org; Mon, 02 May 2011 14:33:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QGxwR-00057W-2p for qemu-devel@nongnu.org; Mon, 02 May 2011 14:33:55 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p42IXrLP030060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 May 2011 14:33:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p42IXrfE003625; Mon, 2 May 2011 14:33:53 -0400 Received: from amt.cnet (vpn-10-54.rdu.redhat.com [10.11.10.54]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p42IXq9s031502; Mon, 2 May 2011 14:33:52 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id E634468A10E; Mon, 2 May 2011 15:33:10 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p42IX3eP003553; Mon, 2 May 2011 15:33:03 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Mon, 2 May 2011 15:32:43 -0300 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 7/9] kvm: Install specialized interrupt handler 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 From: Jan Kiszka KVM only requires to set the raised IRQ in CPUState and to kick the receiving vcpu if it is remote. Installing a specialized handler allows potential future changes to the TCG code path without risking KVM side effects. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 1d7e8ea..fd1fbfe 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -651,6 +651,15 @@ static CPUPhysMemoryClient kvm_cpu_phys_memory_client = { .log_stop = kvm_log_stop, }; +static void kvm_handle_interrupt(CPUState *env, int mask) +{ + env->interrupt_request |= mask; + + if (!qemu_cpu_is_self(env)) { + qemu_cpu_kick(env); + } +} + int kvm_init(void) { static const char upgrade_note[] = @@ -759,6 +768,8 @@ int kvm_init(void) s->many_ioeventfds = kvm_check_many_ioeventfds(); + cpu_interrupt_handler = kvm_handle_interrupt; + return 0; err: