From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apvBZ-0004rV-Ri for qemu-devel@nongnu.org; Tue, 12 Apr 2016 06:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apvBV-0006B4-Dp for qemu-devel@nongnu.org; Tue, 12 Apr 2016 06:04:41 -0400 Received: from smtp.citrix.com ([66.165.176.89]:24284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apvBV-0006Ay-9G for qemu-devel@nongnu.org; Tue, 12 Apr 2016 06:04:37 -0400 Date: Tue, 12 Apr 2016 11:04:35 +0100 From: Anthony PERARD Message-ID: <20160412100435.GC10947@perard.uk.xensource.com> References: <1460455037-28213-1-git-send-email-wei.liu2@citrix.com> <1460455037-28213-2-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1460455037-28213-2-git-send-email-wei.liu2@citrix.com> Subject: Re: [Qemu-devel] [PATCH 1/2] xenfb: use the correct condition to avoid excessive looping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Liu Cc: qemu-devel@nongnu.org, Xen-devel , Stefano Stabellini On Tue, Apr 12, 2016 at 10:57:16AM +0100, Wei Liu wrote: > 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" > Signed-off-by: Wei Liu > Tested-by: "Hao, Xudong" Acked-by: Anthony PERARD > --- > Cc: Stefano Stabellini > Cc: Anthony Perard > > 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 > -- Anthony PERARD