All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Andy Lutomirski <luto@kernel.org>,
	Sebastian Ott <sebott@linux.vnet.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Christoph Hellwig <hch@lst.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	KVM <kvm@vger.kernel.org>, David Woodhouse <dwmw2@infradead.org>,
	Joerg Roedel <jroedel@suse.de>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>
Subject: Re: [PATCH/RFC 0/4] dma ops and virtio
Date: Wed, 4 Nov 2015 18:52:52 +0100	[thread overview]
Message-ID: <20151104185252.199973af.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <20151104152923.6b60ce4c.cornelia.huck@de.ibm.com>

On Wed, 4 Nov 2015 15:29:23 +0100
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:

> I'm currently suspecting some endianness issues, probably with the ecw
> accesses, which is why I'd be interested in your trace information (as
> I currently don't have a LE test setup at hand.)

I think I've got it. We have sense_data as a byte array, which
implicitly makes it BE already. When we copy to the ecws while building
the irb, the data ends up in 32 bit values. The conversion from host
endianness to BE now treats them as LE on your system...

Could you please give the following qemu patch a try?

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index c033612..a13494e 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -892,8 +892,16 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len)
         /* If a unit check is pending, copy sense data. */
         if ((s->dstat & SCSW_DSTAT_UNIT_CHECK) &&
             (p->chars & PMCW_CHARS_MASK_CSENSE)) {
+            uint32_t ecw[8];
+            int i;
+
             irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF | SCSW_FLAGS_MASK_ECTL;
-            memcpy(irb.ecw, sch->sense_data, sizeof(sch->sense_data));
+            /* Attention: sense_data is already BE! */
+            memset(ecw, 0, sizeof(ecw));
+            memcpy(ecw, sch->sense_data, sizeof(sch->sense_data));
+            for (i = 0; i < ARRAY_SIZE(ecw); i++) {
+                irb.ecw[i] = be32_to_cpu(ecw[i]);
+            }
             irb.esw[1] = 0x01000000 | (sizeof(sch->sense_data) << 8);
         }
     }

  reply	other threads:[~2015-11-04 17:52 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 22:48 [PATCH/RFC 0/4] dma ops and virtio Christian Borntraeger
2015-10-27 22:48 ` [PATCH 1/4] Provide simple noop dma ops Christian Borntraeger
2015-10-28  0:41   ` Joerg Roedel
2015-10-30 12:55     ` Christian Borntraeger
2015-10-30 14:45       ` Joerg Roedel
2015-10-27 22:48 ` [PATCH 2/4] alpha: use common " Christian Borntraeger
2015-10-27 22:48 ` [PATCH 3/4] s390/dma: Allow per device " Christian Borntraeger
2015-10-27 22:48 ` [PATCH 4/4] s390/virtio: use noop " Christian Borntraeger
2015-10-28  0:43   ` Joerg Roedel
2015-10-28  8:44     ` Cornelia Huck
2015-10-30 12:56     ` Christian Borntraeger
2015-10-30 12:17   ` Cornelia Huck
2015-10-30 12:26     ` Christian Borntraeger
2015-10-30 12:32       ` Cornelia Huck
2015-10-28  0:45 ` [PATCH/RFC 0/4] dma ops and virtio Joerg Roedel
2015-10-28 22:22 ` Andy Lutomirski
2015-10-29  0:04   ` Christian Borntraeger
2015-10-29 22:50     ` Andy Lutomirski
2015-10-30  8:25       ` Cornelia Huck
2015-10-30 20:33         ` Andy Lutomirski
2015-11-02 11:16           ` Cornelia Huck
2015-11-02 20:23             ` Andy Lutomirski
2015-11-03  8:14               ` Christian Borntraeger
2015-11-03 17:54                 ` Andy Lutomirski
2015-11-03 17:59               ` Cornelia Huck
2015-11-03 18:45                 ` Andy Lutomirski
2015-11-04 14:29                   ` Cornelia Huck
2015-11-04 17:52                     ` Cornelia Huck [this message]
2015-11-04 18:14                       ` Andy Lutomirski
2015-11-05  8:11                         ` Cornelia Huck
2015-11-12  7:56                           ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151104185252.199973af.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=borntraeger@de.ibm.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sebott@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.