All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: qemu-devel@nongnu.org
Cc: anthony.perard@citrix.com, Paul Durrant <paul.durrant@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: [Qemu-devel] [PATCH 1/3] xen: fix quad word bufioreq handling
Date: Wed, 23 Nov 2016 02:24:08 -0700	[thread overview]
Message-ID: <58356E480200007800121296@prv-mh.provo.novell.com> (raw)
In-Reply-To: <58356D610200007800121289@prv-mh.provo.novell.com>

We should not consume the second slot if it didn't get written yet.
Normal writers - i.e. Xen - would not update write_pointer between the
two writes, but the page may get fiddled with by the guest itself, and
we're better off entering an infinite loop in that case.

Reported-by: yanghongke <yanghongke@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
TBD: Alternatively we could call e.g. hw_error() instead.

--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -1021,6 +1021,9 @@ static int handle_buffered_iopage(XenIOS
         xen_rmb();
         qw = (req.size == 8);
         if (qw) {
+            if (rdptr + 1 == wrptr) {
+                break;
+            }
             buf_req = &buf_page->buf_ioreq[(rdptr + 1) %
                                            IOREQ_BUFFER_SLOT_NUM];
             req.data |= ((uint64_t)buf_req->data) << 32;

  parent reply	other threads:[~2016-11-23  9:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  9:20 [Qemu-devel] [PATCH 0/3] xen: XSA-197 follow-ups Jan Beulich
2016-11-23  9:24 ` [PATCH 1/3] xen: fix quad word bufioreq handling Jan Beulich
2016-11-23  9:24 ` Jan Beulich [this message]
2016-11-23  9:48   ` [Qemu-devel] " Paul Durrant
2016-11-23 10:36     ` Jan Beulich
2016-11-23 10:36     ` [Qemu-devel] " Jan Beulich
2016-11-23 10:45       ` Paul Durrant
2016-11-23 11:28         ` Jan Beulich
2016-11-23 11:28         ` [Qemu-devel] " Jan Beulich
2016-11-23 18:01           ` Stefano Stabellini
2016-11-23 18:01             ` Stefano Stabellini
2016-11-23 10:45       ` Paul Durrant
2016-11-23  9:48   ` Paul Durrant
2016-11-23  9:24 ` [Qemu-devel] [PATCH 2/3] xen: slightly simplify " Jan Beulich
2016-11-23  9:24   ` Jan Beulich
2016-11-23  9:51   ` [Qemu-devel] " Paul Durrant
2016-11-23  9:51     ` Paul Durrant
2016-11-23 18:13   ` Stefano Stabellini
2016-11-23 18:13   ` [Qemu-devel] " Stefano Stabellini
2016-11-24 10:31     ` Jan Beulich
2016-11-24 10:31     ` Jan Beulich
2016-11-23  9:25 ` [Qemu-devel] [PATCH 3/3] xen: ignore direction in " Jan Beulich
2016-11-23  9:25   ` Jan Beulich
2016-11-23  9:55   ` [Qemu-devel] " Paul Durrant
2016-11-23  9:55     ` Paul Durrant
2016-11-23 18:16     ` Stefano Stabellini
2016-11-23 18:16     ` [Qemu-devel] " Stefano Stabellini

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=58356E480200007800121296@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=paul.durrant@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.