From patchwork Mon Feb 28 09:10:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 594731 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1S9BJSO006986 for ; Mon, 28 Feb 2011 09:11:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808Ab1B1JLO (ORCPT ); Mon, 28 Feb 2011 04:11:14 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:49007 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034Ab1B1JLE (ORCPT ); Mon, 28 Feb 2011 04:11:04 -0500 Received: by mail-gy0-f174.google.com with SMTP id 20so1435602gyh.19 for ; Mon, 28 Feb 2011 01:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=Tg9L0aAuvG6qE+a0vK2SxUNAle+lwPW7Isq72OAybrg=; b=ZQZD2gCLA/jAFNORA4ElUdKM5vDM3/V9LeAP46L4jklnwZ05ciASjH+vUMKIogIlur Zzsr/7HQNvJPvDN5VDkK+rGhj3o26NQ59Gsm0tO5BctM2kts5QdX9csvg/s2rYmtkN6C xw0MKX9QAaxL4hJPTn6wkK8qunF5jHgt+A/q8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=Vt9exEeU4psMWuIOZQeNg2l2oWGyZgKEjnL8aYclqFKsadBKtneeZOIIc0YFRgxe/H WutXVReA6dLBZIRcDmGmm0H3nqVyknmCu0iSktgOHT3ITDwz00j4LTV2OExLoHrPrfgI fQucKDE7LGk+LyUgFFxW8nzzrzNx+b6amRcIg= Received: by 10.236.110.12 with SMTP id t12mr9243723yhg.6.1298884264463; Mon, 28 Feb 2011 01:11:04 -0800 (PST) Received: from localhost.localdomain (93-34-149-100.ip50.fastwebnet.it [93.34.149.100]) by mx.google.com with ESMTPS id 1sm2037209yhl.11.2011.02.28.01.11.02 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Feb 2011 01:11:03 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, aurelien@aurel32.net, blauwirbel@gmail.com, jan.kiszka@siemes.com, mtosatti@redhat.com Subject: [PATCH v3 uq/master 11/22] always qemu_cpu_kick after unhalting a cpu Date: Mon, 28 Feb 2011 10:10:13 +0100 Message-Id: <1298884224-19734-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1298884224-19734-1-git-send-email-pbonzini@redhat.com> References: <1298884224-19734-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 28 Feb 2011 09:11:19 +0000 (UTC) diff --git a/hw/ppc.c b/hw/ppc.c index 968aec1..de02d33 100644 --- a/hw/ppc.c +++ b/hw/ppc.c @@ -208,6 +208,7 @@ static void ppc970_set_irq (void *opaque, int pin, int level) } else { LOG_IRQ("%s: restart the CPU\n", __func__); env->halted = 0; + qemu_cpu_kick(env); } break; case PPC970_INPUT_HRESET: @@ -300,6 +301,7 @@ static void ppc40x_set_irq (void *opaque, int pin, int level) } else { LOG_IRQ("%s: restart the CPU\n", __func__); env->halted = 0; + qemu_cpu_kick(env); } break; case PPC40x_INPUT_DEBUG: diff --git a/hw/sun4m.c b/hw/sun4m.c index 30e8a21..df3aa32 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -253,15 +253,21 @@ void cpu_check_irqs(CPUState *env) } } +static void cpu_kick_irq(CPUState *env) +{ + env->halted = 0; + cpu_check_irqs(env); + qemu_cpu_kick(env); +} + static void cpu_set_irq(void *opaque, int irq, int level) { CPUState *env = opaque; if (level) { trace_sun4m_cpu_set_irq_raise(irq); - env->halted = 0; env->pil_in |= 1 << irq; - cpu_check_irqs(env); + cpu_kick_irq(env); } else { trace_sun4m_cpu_set_irq_lower(irq); env->pil_in &= ~(1 << irq); diff --git a/hw/sun4u.c b/hw/sun4u.c index 90b1ce2..d282324 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -298,6 +298,7 @@ static void cpu_kick_irq(CPUState *env) { env->halted = 0; cpu_check_irqs(env); + qemu_cpu_kick(env); } static void cpu_set_irq(void *opaque, int irq, int level) @@ -306,9 +307,8 @@ static void cpu_set_irq(void *opaque, int irq, int level) if (level) { CPUIRQ_DPRINTF("Raise CPU IRQ %d\n", irq); - env->halted = 0; env->pil_in |= 1 << irq; - cpu_check_irqs(env); + cpu_kick_irq(env); } else { CPUIRQ_DPRINTF("Lower CPU IRQ %d\n", irq); env->pil_in &= ~(1 << irq); diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index b349812..6e94274 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -194,6 +194,7 @@ static void kvm_s390_interrupt_internal(CPUState *env, int type, uint32_t parm, env->halted = 0; env->exception_index = -1; + qemu_cpu_kick(env); kvmint.type = type; kvmint.parm = parm;