From patchwork Sat Apr 16 22:10:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 91510 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 7D842B6FF0 for ; Sun, 17 Apr 2011 08:14:43 +1000 (EST) Received: from localhost ([::1]:38938 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDlI-0007GG-Qj for incoming@patchwork.ozlabs.org; Sat, 16 Apr 2011 18:14:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDie-0002rJ-Me for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBDid-0002Ds-Ne for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDid-0002Dm-FG for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:55 -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 p3GMBkP8031023 (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 p3GMBkdv001121; Sat, 16 Apr 2011 18:11:46 -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 p3GMBjSi018395; Sat, 16 Apr 2011 18:11:45 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id A6ECB6521E3; Sat, 16 Apr 2011 19:10:26 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p3GMANpv003963; Sat, 16 Apr 2011 19:10:23 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Sat, 16 Apr 2011 19:10:06 -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 , Riku Voipio , qemu-devel@nongnu.org, kvm@vger.kernel.org, Marcelo Tosatti Subject: [Qemu-devel] [PATCH 4/6] Break up user and system cpu_interrupt implementations 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 Both have only two lines in common, and we will convert the system service into a callback which is of no use for user mode operation. Signed-off-by: Jan Kiszka CC: Riku Voipio Signed-off-by: Marcelo Tosatti --- exec.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index b1ee52a..cc0806e 100644 --- a/exec.c +++ b/exec.c @@ -1630,6 +1630,7 @@ static void cpu_unlink_tb(CPUState *env) spin_unlock(&interrupt_lock); } +#ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ void cpu_interrupt(CPUState *env, int mask) { @@ -1638,7 +1639,6 @@ void cpu_interrupt(CPUState *env, int mask) old_mask = env->interrupt_request; env->interrupt_request |= mask; -#ifndef CONFIG_USER_ONLY /* * If called from iothread context, wake the target cpu in * case its halted. @@ -1647,21 +1647,27 @@ void cpu_interrupt(CPUState *env, int mask) qemu_cpu_kick(env); return; } -#endif if (use_icount) { env->icount_decr.u16.high = 0xffff; -#ifndef CONFIG_USER_ONLY if (!can_do_io(env) && (mask & ~old_mask) != 0) { cpu_abort(env, "Raised interrupt while not in I/O function"); } -#endif } else { cpu_unlink_tb(env); } } +#else /* CONFIG_USER_ONLY */ + +void cpu_interrupt(CPUState *env, int mask) +{ + env->interrupt_request |= mask; + cpu_unlink_tb(env); +} +#endif /* CONFIG_USER_ONLY */ + void cpu_reset_interrupt(CPUState *env, int mask) { env->interrupt_request &= ~mask;