All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: qemu-devel@nongnu.org
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony Perard <anthony.perard@citrix.com>
Subject: [Qemu-devel] [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping
Date: Tue, 12 Apr 2016 11:43:14 +0100	[thread overview]
Message-ID: <1460457796-1779-2-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1460457796-1779-1-git-send-email-wei.liu2@citrix.com>

In commit ac0487e1 ("xenfb.c: avoid expensive loops when prod <=
out_cons"), ">=" was used. In fact, a full ring is a legit state.
Correct the test to use ">".

Reported-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: "Hao, Xudong" <xudong.hao@intel.com>
Acked-by: Anthony Perard <anthony.perard@citrix.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>

Backport candidate to our own tree.
---
 hw/display/xenfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 40b096a..9866dfd 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -775,7 +775,7 @@ static void xenfb_handle_events(struct XenFB *xenfb)
 
     prod = page->out_prod;
     out_cons = page->out_cons;
-    if (prod - out_cons >= XENFB_OUT_RING_LEN) {
+    if (prod - out_cons > XENFB_OUT_RING_LEN) {
         return;
     }
     xen_rmb();		/* ensure we see ring contents up to prod */
-- 
2.1.4

  reply	other threads:[~2016-04-12 10:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 10:43 [Qemu-devel] [PATCH v2 0/3] xenfb bug fixes and cleanup Wei Liu
2016-04-12 10:43 ` Wei Liu
2016-04-12 10:43 ` Wei Liu [this message]
2016-04-12 17:12   ` [PATCH v2 1/3] xenfb: use the correct condition to avoid excessive looping Stefano Stabellini
2016-04-12 17:12   ` [Qemu-devel] " Stefano Stabellini
2016-04-22 11:16     ` Anthony PERARD
2016-04-22 11:19       ` Wei Liu
2016-04-22 11:19       ` Wei Liu
2016-04-22 11:16     ` Anthony PERARD
2016-04-12 10:43 ` Wei Liu
2016-04-12 10:43 ` [Qemu-devel] [PATCH v2 2/3] xenfb: move xen_rmb to the correct location Wei Liu
2016-04-12 10:43   ` Wei Liu
2016-04-12 12:57   ` David Vrabel
2016-04-12 12:57   ` [Qemu-devel] [Xen-devel] " David Vrabel
2016-04-12 13:38     ` Andrew Cooper
2016-04-12 13:38     ` [Qemu-devel] [Xen-devel] " Andrew Cooper
2016-04-12 13:46       ` Wei Liu
2016-04-12 13:46       ` [Qemu-devel] [Xen-devel] " Wei Liu
2016-04-12 17:31         ` Stefano Stabellini
2016-04-12 17:31         ` [Qemu-devel] [Xen-devel] " Stefano Stabellini
2016-04-12 10:43 ` [PATCH v2 3/3] xenfb: remove out_cons in xenfb_handle_events Wei Liu
2016-04-12 10:43 ` [Qemu-devel] " Wei Liu
2016-04-12 17:33   ` Stefano Stabellini
2016-04-12 17:33   ` 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=1460457796-1779-2-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.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.