From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asAK5-0002bE-V7 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 10:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asAK2-0001Pa-1j for qemu-devel@nongnu.org; Mon, 18 Apr 2016 10:38:45 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:45467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asAK1-0001PP-S5 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 10:38:41 -0400 Date: Mon, 18 Apr 2016 15:40:15 +0100 From: Wei Liu Message-ID: <20160418144015.GA26228@citrix.com> References: <1460983308-28000-1-git-send-email-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1460983308-28000-1-git-send-email-samuel.thibault@ens-lyon.org> Subject: Re: [Qemu-devel] [PATCH] xenfb: Fix overzealous ring test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault Cc: qemu-devel@nongnu.org, Wei Liu , Stefano Stabellini , Anthony Perard , xen-devel@lists.xensource.com On Mon, Apr 18, 2016 at 02:41:48PM +0200, Samuel Thibault wrote: > From: Wei Liu > > pv-grub booting got broken with recent qemu-xen, due to > ac0487e1d2ae811cd4d035741a109a4ecfb013f1 ('xenfb.c: avoid expensive loops > when prod <= out_cons') > > prod - out_cons can actually be XENFB_OUT_RING_LEN when the ring is exactly > full, this is a normal condition and should not be excluded. > > From: Wei Liu > Signed-off-by: Samuel Thibault > Tested-by: Hao Xudong Hi Samuel, This patch is already queued by Stefano. After it has been applied upstream we will backport it to our own tree. Wei. > --- > 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.8.0.rc3 >