From patchwork Mon Apr 18 12:41:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 8872031 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45ADEBF29F for ; Mon, 18 Apr 2016 12:42:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A026220303 for ; Mon, 18 Apr 2016 12:42:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E98172026C for ; Mon, 18 Apr 2016 12:42:05 +0000 (UTC) Received: from localhost ([::1]:36945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as8VB-0000i0-0C for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Apr 2016 08:42:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as8V3-0000eb-Av for qemu-devel@nongnu.org; Mon, 18 Apr 2016 08:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1as8Uz-0002o4-8A for qemu-devel@nongnu.org; Mon, 18 Apr 2016 08:41:57 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:47046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as8Uz-0002nc-1Z for qemu-devel@nongnu.org; Mon, 18 Apr 2016 08:41:53 -0400 X-IronPort-AV: E=Sophos;i="5.24,502,1454972400"; d="scan'208";a="174925906" Received: from nat-inria-bordeaux-52-gw-01-bso.bordeaux.inria.fr (HELO var.youpi.perso.aquilenet.fr) ([194.199.1.52]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 18 Apr 2016 14:41:50 +0200 Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.87) (envelope-from ) id 1as8Uw-0007IH-1O; Mon, 18 Apr 2016 14:41:50 +0200 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 18 Apr 2016 14:41:48 +0200 Message-Id: <1460983308-28000-1-git-send-email-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.8.0.rc3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.104 Subject: [Qemu-devel] [PATCH] xenfb: Fix overzealous ring test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , Samuel Thibault , Stefano Stabellini , Wei Liu , xen-devel@lists.xensource.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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 --- 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 */