From patchwork Sat Apr 16 22:10:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 91504 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 5B9D8B7014 for ; Sun, 17 Apr 2011 08:12:17 +1000 (EST) Received: from localhost ([::1]:58901 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiu-0002i0-Sm for incoming@patchwork.ozlabs.org; Sat, 16 Apr 2011 18:12:12 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiY-0002ft-Dp for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBDiW-0002Cd-Su for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiW-0002Bz-Je for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:48 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3GMBjPE009562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 16 Apr 2011 18:11:46 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3GMBjki001116; Sat, 16 Apr 2011 18:11:45 -0400 Received: from amt.cnet (vpn-9-82.rdu.redhat.com [10.11.9.82]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p3GMBhGw018389; Sat, 16 Apr 2011 18:11:44 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id AD59B6521E5; Sat, 16 Apr 2011 19:10:30 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p3GMASAe003965; Sat, 16 Apr 2011 19:10:28 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Sat, 16 Apr 2011 19:10:08 -0300 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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 6/6] 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: