From patchwork Tue Jul 8 13:29:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 367919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A9B741400A0 for ; Wed, 9 Jul 2014 00:25:57 +1000 (EST) Received: from localhost ([::1]:55563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4VTb-0003Zp-LM for incoming@patchwork.ozlabs.org; Tue, 08 Jul 2014 09:30:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4VSp-0002oO-AK for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4VSd-0008Hy-OG for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:43 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:52758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4VSd-0008Hu-FL for qemu-devel@nongnu.org; Tue, 08 Jul 2014 09:29:31 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jul 2014 14:29:30 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Jul 2014 14:29:27 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id C0AF42190066 for ; Tue, 8 Jul 2014 14:29:13 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s68DTQlS35389674 for ; Tue, 8 Jul 2014 13:29:26 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s68DTQW0018110 for ; Tue, 8 Jul 2014 09:29:26 -0400 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-107.boeblingen.de.ibm.com [9.152.224.107]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s68DTMmt017950; Tue, 8 Jul 2014 09:29:25 -0400 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 8 Jul 2014 15:29:18 +0200 Message-Id: <1404826158-2735-4-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404826158-2735-1-git-send-email-cornelia.huck@de.ibm.com> References: <1404826158-2735-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14070813-1948-0000-0000-00000074F9CA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.110 Cc: peter.maydell@linaro.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, aliguori@amazon.com, Cornelia Huck Subject: [Qemu-devel] [PULL for-2.1 3/3] s390x/css: reflect cpa in scsw 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 We neglected to update the the channel-program-address field of the scsw after completion of the start or the halt function: Fortunately, Linux didn't miss it so far. Let's update it for the cases where the cpa is expected to be valid; in some cases, the cpa is 'unpredictable', so we leave it untouched. Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index e758890..49c2aaf 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -200,6 +200,7 @@ static void sch_handle_halt_func(SubchDev *sch) PMCW *p = &sch->curr_status.pmcw; SCSW *s = &sch->curr_status.scsw; + hwaddr curr_ccw = sch->channel_prog; int path; /* Path management: In our simple css, we always choose the only path. */ @@ -216,6 +217,10 @@ static void sch_handle_halt_func(SubchDev *sch) (s->ctrl & SCSW_ACTL_SUSP))) { s->dstat = SCSW_DSTAT_DEVICE_END; } + if ((s->ctrl & (SCSW_ACTL_SUBCH_ACTIVE | SCSW_ACTL_DEVICE_ACTIVE)) || + (s->ctrl & SCSW_ACTL_SUSP)) { + s->cpa = curr_ccw + 8; + } s->cstat = 0; p->lpum = path; @@ -398,6 +403,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb) s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_STATUS_PEND; s->dstat = SCSW_DSTAT_CHANNEL_END | SCSW_DSTAT_DEVICE_END; + s->cpa = sch->channel_prog + 8; break; case -ENOSYS: /* unsupported command, generate unit check (command reject) */ @@ -408,6 +414,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb) s->ctrl &= ~SCSW_CTRL_MASK_STCTL; s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; + s->cpa = sch->channel_prog + 8; break; case -EFAULT: /* memory problem, generate channel data check */ @@ -416,6 +423,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb) s->ctrl &= ~SCSW_CTRL_MASK_STCTL; s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; + s->cpa = sch->channel_prog + 8; break; case -EBUSY: /* subchannel busy, generate deferred cc 1 */ @@ -436,6 +444,7 @@ static void sch_handle_start_func(SubchDev *sch, ORB *orb) s->ctrl &= ~SCSW_CTRL_MASK_STCTL; s->ctrl |= SCSW_STCTL_PRIMARY | SCSW_STCTL_SECONDARY | SCSW_STCTL_ALERT | SCSW_STCTL_STATUS_PEND; + s->cpa = sch->channel_prog + 8; break; } } while (ret == -EAGAIN);