All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	Cornelia Huck <cohuck@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code
Date: Tue, 16 Feb 2021 11:43:18 +0000	[thread overview]
Message-ID: <CAFEAcA_R9vgujvdBhcMTVeB9yktp81Yxz-F8fPMniTHDZEnHLw@mail.gmail.com> (raw)
In-Reply-To: <20210216110056.1228582-1-thuth@redhat.com>

On Tue, 16 Feb 2021 at 11:01, Thomas Huth <thuth@redhat.com> wrote:
> According to the virtio specification, a memory barrier should be
> used before incrementing the idx field in the "available" ring.
> So far, we did not do this in the s390-ccw bios yet, but recently
> Peter Maydell saw problems with the s390-ccw bios when running
> the qtests on an aarch64 host (the bios panic'ed with the message:
> "SCSI cannot report LUNs: response VS RESP=09"), which could
> maybe be related to the missing memory barriers. Thus let's add
> those barriers now. Since we've only seen the problem on TCG so far,
> a "bcr 14,0" should be sufficient here to trigger the tcg_gen_mb()
> in the TCG translate code.
>
> (Note: The virtio spec also talks about using a memory barrier
> *after* incrementing the idx field, but if I understood correctly
> this is only required when using notification suppression - which
> we don't use in the s390-ccw bios here)
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

This noticeably increases the reliability of the test for me:
it goes from failing one time in 2 or 3 to failing about one time
in 5 or 6. However it does still hit the virtio_scsi_parse_req()
check on "out_size && in_size" eventually. So my guess is that this
is not a sufficient supply of barriers. I'm firmly not a virtio expert
but my reading of the spec suggested that some of the way the
s390-ccw code is doing things might be in the wrong order and
need restructuring beyond merely "add barriers to existing code".

thanks
-- PMM


  reply	other threads:[~2021-02-16 11:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 11:00 [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code Thomas Huth
2021-02-16 11:43 ` Peter Maydell [this message]
2021-02-16 11:47   ` Thomas Huth
2021-02-16 11:47 ` Cornelia Huck
2021-02-16 14:21   ` Thomas Huth
2021-02-16 14:30     ` Cornelia Huck
2021-02-16 14:32       ` Peter Maydell
2021-02-16 14:35         ` Thomas Huth
2021-02-16 14:37           ` Peter Maydell
2021-02-16 14:49             ` Cornelia Huck
2021-02-16 14:40 ` Halil Pasic
2021-02-16 15:17   ` Cornelia Huck
2021-02-16 16:15   ` Thomas Huth
2021-02-16 16:44     ` Peter Maydell
2021-02-16 17:11     ` Halil Pasic
2021-02-17  4:31     ` Richard Henderson
2021-02-17 11:15       ` Peter Maydell
2021-02-17 15:11         ` Richard Henderson

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=CAFEAcA_R9vgujvdBhcMTVeB9yktp81Yxz-F8fPMniTHDZEnHLw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.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.