From nobody Sun May 5 21:46:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1594320459; cv=none; d=zohomail.com; s=zohoarc; b=j1GOaDyEC7R9U/w9qtSAyMdeHHDc6cKpw7qTu3W8LtIegzXOcfg1Shln1Na3+hq/0/wHeRq9Ep6sMpM6sbCgB8MxnGNqdANBCegbdcyj1RogJLB2hRYldZcpzG11ALbo41Rr8LmYWs1/OLcWFyeFn89w5PKDS+QaijfmA8fDI4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594320459; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=yAia7M8H/OX8wdWtPuYtBpWuLcvugvT5fqNIY3v1cqc=; b=FO/bGpJ8pyVbU/DlmLj1xCjvMZAn0dkirWKSdLN8M067h/QFgdvZx8w1b10z9N/b5nl2+mqDp5P+bx9dn6Wougb6lFcGaGqdQHhudbjZkmCLc7CAGiWaESzh2P+m/iCG5RMOMEO/pUoa3XPYeZRR/KbrP91jlXKKNB/TSieQjIY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1594320459209671.1927068448883; Thu, 9 Jul 2020 11:47:39 -0700 (PDT) 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 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) 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 X-Inumbo-ID: 8e1ceed0-c214-11ea-8efe-12813bfff9fa 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=; 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" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D 19 and prod =3D 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 =3D ACCESS_ONCE(xb_ring->rsp_prod); uint32_t cons =3D ACCESS_ONCE(xb_ring->rsp_cons); =20 - part =3D mask_xenbus_idx(prod - cons); + part =3D prod - cons; =20 /* No data? Kick xenstored and wait for it to produce some data. = */ if ( !part ) --=20 2.17.1