Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C0EAC433E0 for ; Thu, 9 Jul 2020 18:47:34 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C1EE420775 for ; Thu, 9 Jul 2020 18:47:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xen.org header.i=@xen.org header.b="bMBXouJo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1EE420775 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jtbZO-0005iK-Ud; Thu, 09 Jul 2020 18:46:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jtbZN-0005iF-UD for xen-devel@lists.xenproject.org; Thu, 09 Jul 2020 18:46:54 +0000 X-Inumbo-ID: 8e1ceed0-c214-11ea-8efe-12813bfff9fa Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8e1ceed0-c214-11ea-8efe-12813bfff9fa; Thu, 09 Jul 2020 18:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yAia7M8H/OX8wdWtPuYtBpWuLcvugvT5fqNIY3v1cqc=; b=bMBXouJoV4o2CuzXEwfCBzv6T3 afu8X8hl70PQzWx83a5qLbJhQHOzWG5satYVHQYIQJrrmgfdJYyig7AVLc0+JVxOg010KBS7Xm2g7 1ADGmb9Mq9YmXnjVwEzxATbDMRvO8bJbq+Y2mnZ09Be1G96RA3bpERRFamABP1pVge9Y=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jtbZK-0005Dk-W6; Thu, 09 Jul 2020 18:46:50 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtbZK-00010P-L6; Thu, 09 Jul 2020 18:46:50 +0000 From: Julien Grall To: andrew.cooper3@citrix.com Subject: [XTF] xenbus: Don't wait if the response ring is full Date: Thu, 9 Jul 2020 19:46:47 +0100 Message-Id: <20200709184647.5159-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: wipawel@amazon.de, Julien Grall , xen-devel@lists.xenproject.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall XenStore response can be bigger than the response ring. In this case, it is possible to have the ring full (e.g cons = 19 and prod = 1043). However, XTF will consider that there is no data and therefore wait for more input. This will result to block indefinitely as the ring is full. This can be solved by avoiding to mask the difference between prod and cons. Signed-off-by: Julien Grall --- common/xenbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/xenbus.c b/common/xenbus.c index 24fff4872372..f3bb30ac693f 100644 --- a/common/xenbus.c +++ b/common/xenbus.c @@ -75,7 +75,7 @@ static void xenbus_read(void *data, size_t len) uint32_t prod = ACCESS_ONCE(xb_ring->rsp_prod); uint32_t cons = ACCESS_ONCE(xb_ring->rsp_cons); - part = mask_xenbus_idx(prod - cons); + part = prod - cons; /* No data? Kick xenstored and wait for it to produce some data. */ if ( !part ) -- 2.17.1