From patchwork Thu Feb 7 12:20:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 218908 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 F0E032C0294 for ; Thu, 7 Feb 2013 23:21:40 +1100 (EST) Received: from localhost ([::1]:37773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QTz-0006HN-3F for incoming@patchwork.ozlabs.org; Thu, 07 Feb 2013 07:21:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QTN-0004mJ-R4 for qemu-devel@nongnu.org; Thu, 07 Feb 2013 07:21:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3QTI-0002oy-UL for qemu-devel@nongnu.org; Thu, 07 Feb 2013 07:21:01 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:35713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3QTI-0002oE-La for qemu-devel@nongnu.org; Thu, 07 Feb 2013 07:20:56 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Feb 2013 12:19:33 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 7 Feb 2013 12:19:31 -0000 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r17CKhGG22020286 for ; Thu, 7 Feb 2013 12:20:43 GMT Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r17CKqou016493 for ; Thu, 7 Feb 2013 05:20:52 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r17CKp2Q016469; Thu, 7 Feb 2013 05:20:51 -0700 From: Cornelia Huck To: Alexander Graf Date: Thu, 7 Feb 2013 13:20:50 +0100 Message-Id: <1360239651-52283-2-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1360239651-52283-1-git-send-email-cornelia.huck@de.ibm.com> References: <1360239651-52283-1-git-send-email-cornelia.huck@de.ibm.com> x-cbid: 13020712-2966-0000-0000-000006AA9B2F X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.109 Cc: Christian Borntraeger , Jens Freimann , qemu-devel Subject: [Qemu-devel] [PATCH 1/2] s390: Keep I/O interrupts enabled for all iscs. 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 do_io_interrupt() would stop scanning further iscs if it found an I/O interrupt it could inject. This might cause the pending interrupt indication for I/O interrupts to be reset although there might be queued I/O interrupts for subsequent iscs. Fix this by reordering the logic: Inject the I/O interrupt immediately and continue searching all iscs for queued interrupts. Signed-off-by: Cornelia Huck --- target-s390x/helper.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 043feb2..9f9088b 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -617,7 +617,6 @@ static void do_ext_interrupt(CPUS390XState *env) static void do_io_interrupt(CPUS390XState *env) { - uint64_t mask = 0, addr = 0; LowCore *lowcore; IOIntQueue *q; uint8_t isc; @@ -642,36 +641,39 @@ static void do_io_interrupt(CPUS390XState *env) disable = 0; continue; } - found = 1; - lowcore = cpu_map_lowcore(env); + if (!found) { + uint64_t mask, addr; - lowcore->subchannel_id = cpu_to_be16(q->id); - lowcore->subchannel_nr = cpu_to_be16(q->nr); - lowcore->io_int_parm = cpu_to_be32(q->parm); - lowcore->io_int_word = cpu_to_be32(q->word); - lowcore->io_old_psw.mask = cpu_to_be64(get_psw_mask(env)); - lowcore->io_old_psw.addr = cpu_to_be64(env->psw.addr); - mask = be64_to_cpu(lowcore->io_new_psw.mask); - addr = be64_to_cpu(lowcore->io_new_psw.addr); + found = 1; + lowcore = cpu_map_lowcore(env); - cpu_unmap_lowcore(lowcore); + lowcore->subchannel_id = cpu_to_be16(q->id); + lowcore->subchannel_nr = cpu_to_be16(q->nr); + lowcore->io_int_parm = cpu_to_be32(q->parm); + lowcore->io_int_word = cpu_to_be32(q->word); + lowcore->io_old_psw.mask = cpu_to_be64(get_psw_mask(env)); + lowcore->io_old_psw.addr = cpu_to_be64(env->psw.addr); + mask = be64_to_cpu(lowcore->io_new_psw.mask); + addr = be64_to_cpu(lowcore->io_new_psw.addr); - env->io_index[isc]--; + cpu_unmap_lowcore(lowcore); + + env->io_index[isc]--; + + DPRINTF("%s: %" PRIx64 " %" PRIx64 "\n", __func__, + env->psw.mask, env->psw.addr); + load_psw(env, mask, addr); + } if (env->io_index[isc] >= 0) { disable = 0; } - break; + continue; } if (disable) { env->pending_int &= ~INTERRUPT_IO; } - if (found) { - DPRINTF("%s: %" PRIx64 " %" PRIx64 "\n", __func__, - env->psw.mask, env->psw.addr); - load_psw(env, mask, addr); - } } static void do_mchk_interrupt(CPUS390XState *env)