From patchwork Wed Apr 20 11:15:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 8888831 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 875739F1D3 for ; Wed, 20 Apr 2016 11:17:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B144120211 for ; Wed, 20 Apr 2016 11:17:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E5A51201B4 for ; Wed, 20 Apr 2016 11:17:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asq6l-0001Hr-6Z; Wed, 20 Apr 2016 11:15:47 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asq6j-0001H0-Fo for xen-devel@lists.xensource.com; Wed, 20 Apr 2016 11:15:45 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id E3/33-23864-0E467175; Wed, 20 Apr 2016 11:15:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42I5NlG2Q/dBini 4wYIPrBb3prxnd2D02N63iz2AMYo1My8pvyKBNePN/EPsBU/YKw7/2M3awLiXrYuRi0NIYCqj RO/TdywQzkQmiS3vPrN2MXJysAkYSvx9sokNxBYRkJHovLSIEcRmFiiS2PT/OFMXIweHsEC4x KS5XCBhFgFViSl/zrOA2LwCbhLPW7uZQGwJATmJk8cmg43kFPCR2H7yMzOILSTgLfGyewULRE 2GxLyeOawQtpfEohuXoGw1iavnNjFPYORbwMiwilGjOLWoLLVI19BEL6koMz2jJDcxM0fX0MB YLze1uDgxPTUnMalYLzk/dxMjMEwYgGAH44rtnocYJTmYlER5VQXEw4X4kvJTKjMSizPii0pz UosPMcpwcChJ8DIAw05IsCg1PbUiLTMHGLAwaQkOHiUR3rpkoDRvcUFibnFmOkTqFKMux4Ift 9cyCbHk5eelSonzHgMpEgApyijNgxsBi55LjLJSwryMQEcJ8RSkFuVmlqDKv2IU52BUEub9CT KFJzOvBG7TK6AjmICO4L8rCnJESSJCSqqBkZ91Qzfjbs2Kj7VFD47bs4gKZX19q8frtnhZlfP ZmZ8m3ZIWcDn5p/PJ1TnmJ5PDs3T/nnge4ObZ39kwMa/Q9lXO6TeFZokztPL0JjWpf/SQzN53 1SIknrnBM235flOxhyKftNnehwtt/Dux5opLyZkgwfqXZ7kD7q67+3r1I/5UUX2p+d2iSizFG YmGWsxFxYkA8XU20JkCAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-16.tower-31.messagelabs.com!1461150942!28392856!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3173 invoked from network); 20 Apr 2016 11:15:43 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-16.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Apr 2016 11:15:43 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0E4C201B4; Wed, 20 Apr 2016 11:15:40 +0000 (UTC) Received: from localhost.localdomain (107.238.189.80.dyn.plus.net [80.189.238.107]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4AFE20165; Wed, 20 Apr 2016 11:15:38 +0000 (UTC) From: Stefano Stabellini To: peter.maydell@linaro.org Date: Wed, 20 Apr 2016 12:15:22 +0100 Message-Id: <1461150922-14509-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xensource.com, sstabellini@kernel.org, Wei Liu , qemu-devel@nongnu.org Subject: [Xen-devel] [PULL for-2.6 1/1] xenfb: use the correct condition to avoid excessive looping X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Liu 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 Signed-off-by: Stefano Stabellini --- 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 */