All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] xen: fix quad word bufioreq handling
Date: Wed, 23 Nov 2016 09:48:09 +0000	[thread overview]
Message-ID: <27145c26bfa849779baa52deddd09294@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <58356E480200007800121296@prv-mh.provo.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 23 November 2016 09:24
> To: qemu-devel@nongnu.org
> Cc: Anthony Perard <anthony.perard@citrix.com>; Paul Durrant
> <Paul.Durrant@citrix.com>; Stefano Stabellini <sstabellini@kernel.org>; xen-
> devel <xen-devel@lists.xenproject.org>
> Subject: [PATCH 1/3] xen: fix quad word bufioreq handling
> 
> 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.
> 

Xen would never put QEMU in this situation and the guest can't actually modify the page whilst it's in use, since activation of the IOREQ server removes the page from the guest's p2m so the premise of the patch is not correct.

  Paul

> 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;
> 
> 

  reply	other threads:[~2016-11-23  9:48 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 ` [Qemu-devel] " Jan Beulich
2016-11-23  9:48   ` Paul Durrant [this message]
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=27145c26bfa849779baa52deddd09294@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=anthony.perard@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.