From patchwork Tue Nov 3 17:59:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 7545871 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 474CC9F36A for ; Tue, 3 Nov 2015 17:59:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F9802070A for ; Tue, 3 Nov 2015 17:59:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A0CC206FE for ; Tue, 3 Nov 2015 17:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755683AbbKCR7j (ORCPT ); Tue, 3 Nov 2015 12:59:39 -0500 Received: from e06smtp06.uk.ibm.com ([195.75.94.102]:59833 "EHLO e06smtp06.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755564AbbKCR7h (ORCPT ); Tue, 3 Nov 2015 12:59:37 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Nov 2015 17:59:34 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp06.uk.ibm.com (192.168.101.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Nov 2015 17:59:32 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: kvm@vger.kernel.org;linux-s390@vger.kernel.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6AB952190068; Tue, 3 Nov 2015 17:59:27 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tA3HxV5K64356580; Tue, 3 Nov 2015 17:59:31 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 tA3HxTJ1004203; Tue, 3 Nov 2015 10:59:31 -0700 Received: from gondolin (dyn-9-152-224-100.boeblingen.de.ibm.com [9.152.224.100]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tA3HxTnf004173; Tue, 3 Nov 2015 10:59:29 -0700 Date: Tue, 3 Nov 2015 18:59:26 +0100 From: Cornelia Huck To: Andy Lutomirski Cc: Christian Borntraeger , Andy Lutomirski , Sebastian Ott , Paolo Bonzini , Christoph Hellwig , Benjamin Herrenschmidt , KVM , David Woodhouse , Joerg Roedel , Martin Schwidefsky , linux-s390 Subject: Re: [PATCH/RFC 0/4] dma ops and virtio Message-ID: <20151103185926.1442d0a8.cornelia.huck@de.ibm.com> In-Reply-To: References: <1445986131-239566-1-git-send-email-borntraeger@de.ibm.com> <5631629B.2050505@de.ibm.com> <20151030092548.7abd51e1.cornelia.huck@de.ibm.com> <20151102121658.11aa3375.cornelia.huck@de.ibm.com> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110317-0025-0000-0000-000004CBB5F0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, 2 Nov 2015 12:23:25 -0800 Andy Lutomirski wrote: > No change. I'm stumped :( Here's what I see: (...) > CH DBG: css_interpret_ccw: cmd_code=e4 > CH DBG: css_interpret_ccw: ret=0 sense id -> works (...) > CH DBG: css_interpret_ccw: cmd_code=3 > CH DBG: css_interpret_ccw: ret=0 nop (path verification) -> works > CH DBG: css_interpret_ccw: cmd_code=83 > CH DBG: css_interpret_ccw: ret=-38 set revision -> -ENOSYS This is fine; the virtio device is in legacy mode and the kernel will try revision 1; qemu will reject this. The code should end up generating a unit check with command reject, however... > qeth: register layer 2 discipline > qeth: register layer 3 discipline > oprofile: using timer interrupt. > NET: Registered protocol family 10 > virtio_ccw 0.0.0000: Failed to set online: -5 ...this shows the kernel driver somehow did not end up with that command reject (it would have triggered a retry with revision 0, and the return code shows that no unit check/command reject was detected, but some other error.) > The lack of much interesting output makes me think that maybe I > misconfigured something. It's just failing very early in the setup phase. As it works for me with a kvm setup, I'm suspecting some error in qemu's emulation code, which is unfortunately not my turf. Some more poke-around-in-the-dark ideas: - Do you get more debug out put when you switch back to s390-ccw-virtio (virtio-1), i.e. does cmd 83 work and is it followed by further commands? - Can you try with the following qemu logging patch -----8<----------8<----- -----8<----------8<----- Just to verify that qemu will produce and the kernel end up with the irb I'd expect. I'd rather prefer us getting the dma stuff right instead of chasing qemu issues :/ --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/s390x/css.c b/hw/s390x/css.c index c033612..80853a6 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -868,6 +868,7 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) PMCW *p = &sch->curr_status.pmcw; uint16_t stctl; IRB irb; + int i; if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) { return 3; @@ -898,6 +899,14 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) } } /* Store the irb to the guest. */ + fprintf(stderr, "CH DBG: %s: flags=%04x ctrl=%04x cpa=%08x\n", + __func__, irb.scsw.flags, irb.scsw.ctrl, irb.scsw.cpa); + fprintf(stderr, "CH DBG: %s: dstat=%02x cstat=%02x count=%04x\n", + __func__, irb.scsw.dstat, irb.scsw.cstat, irb.scsw.count); + for (i = 0; i < ARRAY_SIZE(irb.ecw); i++) { + fprintf(stderr, "CH DBG: %s: ecw[%d]=%08x\n", __func__, + i, irb.ecw[i]); + } copy_irb_to_guest(target_irb, &irb, p, irb_len); return ((stctl & SCSW_STCTL_STATUS_PEND) == 0); -----8<----------8<----- and the following kernel patch -----8<----------8<----- diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 83da53c..ea4db09 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -540,6 +540,9 @@ callback: create_fake_irb(&cdev->private->irb, cdev->private->flags.fake_irb); cdev->private->flags.fake_irb = 0; + CIO_TRACE_EVENT(0, "fake_irb"); + CIO_HEX_EVENT(0, &cdev->private->irb, + sizeof(struct irb)); if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, &cdev->private->irb); diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 6acd0b5..e9bf357 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -446,6 +446,8 @@ ccw_device_call_handler(struct ccw_device *cdev) /* * Now we are ready to call the device driver interrupt handler. */ + CIO_TRACE_EVENT(0, "irb"); + CIO_HEX_EVENT(0, &cdev->private->irb, sizeof(struct irb)); if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, &cdev->private->irb);