From nobody Thu Mar 28 20:31:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1590090672; cv=none; d=zohomail.com; s=zohoarc; b=VUxIFT7TKWgsvXiazz+g9xPjihkokB3ogB+kXNOXLy7JAD00o9g7hLioBXvRDOq/g8Db9Q6UaqhhdhaLi2SWu84t4EcNldJTmVXxC03EDKjNKTO6T8sxRGA9wSQPW6jxdK6PFYeyK9Wt7j+NG3lgsbGIz1PDxaWKssdLxiDZ4sc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590090672; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=qNK8HOfOERYDGCC0ji1l54rjaCBIg9JJO4A8Cz38als=; b=mUo238/nOwxYltuS29wDaITTppEPd1HD+xGtujcEMYFjmf8Ypn8m1M1/K1OMv4wmQP6Z7cLyKlj8BN96/zq1NFZSlU5yGS6MRYCuVf1e9VqM9+ppzx1LceFsZoAGHlqfw5x5XYGqHQ0/MUmDBB6PjvL4AolRenMo5mOOqgZ6Tcg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590090672576480.5533848182524; Thu, 21 May 2020 12:51:12 -0700 (PDT) Received: from localhost ([::1]:47186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbrDj-0000tM-94 for importer@patchew.org; Thu, 21 May 2020 15:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqpq-0007s6-Tl for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqpp-0002Yo-Mo for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:30 -0400 Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F7D3207D3; Thu, 21 May 2020 19:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590089188; bh=4/W/Pzh2gymBGgKA7KnPmOduUQtI3QITX4oFPL4mDos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LIm50GH3gCsK1fkk/pcT0oUfmzGJez/VfeETMOP9gosq2QKQFyIaF6GGwLlIhxvmW k0cfMgHuugWpd6lpPnraWZdC3hRO0Y6AtCgJxUEz5QNGcsdUYB4ZvuUtv7kpLmOju2 jkaEQ8eatNhlSvzbJWeSggy23+jDcxo6RtnDGVMg= From: Stefano Stabellini To: groug@kaod.org Subject: [PATCH v2 1/3] Revert "9p: init_in_iov_from_pdu can truncate the size" Date: Thu, 21 May 2020 12:26:25 -0700 Message-Id: <20200521192627.15259-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.145.29.99; envelope-from=sstabellini@kernel.org; helo=mail.kernel.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 15:26:19 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, paul@xen.org, qemu_oss@crudebyte.com, qemu-devel@nongnu.org, anthony.perard@citrix.com, Stefano Stabellini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-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: Stefano Stabellini This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7. It causes https://bugs.launchpad.net/bugs/1877688. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck --- hw/9pfs/9p.c | 33 +++++++++++---------------------- hw/9pfs/9p.h | 2 +- hw/9pfs/virtio-9p-device.c | 11 ++++------- hw/9pfs/xen-9p-backend.c | 15 ++++++--------- 4 files changed, 22 insertions(+), 39 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index a2a14b5979..d39bfee462 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2102,29 +2102,22 @@ out_nofid: * with qemu_iovec_destroy(). */ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu, - size_t skip, size_t *size, + size_t skip, size_t size, bool is_write) { QEMUIOVector elem; struct iovec *iov; unsigned int niov; - size_t alloc_size =3D *size + skip; =20 if (is_write) { - pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, alloc_s= ize); + pdu->s->transport->init_out_iov_from_pdu(pdu, &iov, &niov, size + = skip); } else { - pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, &alloc_s= ize); - } - - if (alloc_size < skip) { - *size =3D 0; - } else { - *size =3D alloc_size - skip; + pdu->s->transport->init_in_iov_from_pdu(pdu, &iov, &niov, size + s= kip); } =20 qemu_iovec_init_external(&elem, iov, niov); qemu_iovec_init(qiov, niov); - qemu_iovec_concat(qiov, &elem, skip, *size); + qemu_iovec_concat(qiov, &elem, skip, size); } =20 static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, @@ -2132,14 +2125,15 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *p= du, V9fsFidState *fidp, { ssize_t err; size_t offset =3D 7; - size_t read_count; + uint64_t read_count; QEMUIOVector qiov_full; =20 if (fidp->fs.xattr.len < off) { read_count =3D 0; - } else if (fidp->fs.xattr.len - off < max_count) { - read_count =3D fidp->fs.xattr.len - off; } else { + read_count =3D fidp->fs.xattr.len - off; + } + if (read_count > max_count) { read_count =3D max_count; } err =3D pdu_marshal(pdu, offset, "d", read_count); @@ -2148,7 +2142,7 @@ static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu= , V9fsFidState *fidp, } offset +=3D err; =20 - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &read_count, false); + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, read_count, false); err =3D v9fs_pack(qiov_full.iov, qiov_full.niov, 0, ((char *)fidp->fs.xattr.value) + off, read_count); @@ -2277,11 +2271,9 @@ static void coroutine_fn v9fs_read(void *opaque) QEMUIOVector qiov_full; QEMUIOVector qiov; int32_t len; - size_t size =3D max_count; =20 - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, &size, false); + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset + 4, max_count, fa= lse); qemu_iovec_init(&qiov, qiov_full.niov); - max_count =3D size; do { qemu_iovec_reset(&qiov); qemu_iovec_concat(&qiov, &qiov_full, count, qiov_full.size - c= ount); @@ -2532,7 +2524,6 @@ static void coroutine_fn v9fs_write(void *opaque) int32_t len =3D 0; int32_t total =3D 0; size_t offset =3D 7; - size_t size; V9fsFidState *fidp; V9fsPDU *pdu =3D opaque; V9fsState *s =3D pdu->s; @@ -2545,9 +2536,7 @@ static void coroutine_fn v9fs_write(void *opaque) return; } offset +=3D err; - size =3D count; - v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, &size, true); - count =3D size; + v9fs_init_qiov_from_pdu(&qiov_full, pdu, offset, count, true); trace_v9fs_write(pdu->tag, pdu->id, fid, off, count, qiov_full.niov); =20 fidp =3D get_fid(pdu, fid); diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index dd1c6cb8d2..1b9e110605 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -436,7 +436,7 @@ struct V9fsTransport { ssize_t (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char = *fmt, va_list ap); void (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, size_t *size); + unsigned int *pniov, size_t size); void (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov, unsigned int *pniov, size_t size); void (*push_and_notify)(V9fsPDU *pdu); diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index e5b44977c7..36f3aa9352 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -147,22 +147,19 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, si= ze_t offset, } =20 static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, - unsigned int *pniov, size_t *size) + unsigned int *pniov, size_t size) { V9fsState *s =3D pdu->s; V9fsVirtioState *v =3D container_of(s, V9fsVirtioState, state); VirtQueueElement *elem =3D v->elems[pdu->idx]; size_t buf_size =3D iov_size(elem->in_sg, elem->in_num); =20 - if (buf_size < P9_IOHDRSZ) { + if (buf_size < size) { VirtIODevice *vdev =3D VIRTIO_DEVICE(v); =20 virtio_error(vdev, - "VirtFS reply type %d needs %zu bytes, buffer has %zu= , less than minimum", - pdu->id + 1, *size, buf_size); - } - if (buf_size < *size) { - *size =3D buf_size; + "VirtFS reply type %d needs %zu bytes, buffer has %zu= ", + pdu->id + 1, size, buf_size); } =20 *piov =3D elem->in_sg; diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index f04caabfe5..fc197f6c8a 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -188,7 +188,7 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu, static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, unsigned int *pniov, - size_t *size) + size_t size) { Xen9pfsDev *xen_9pfs =3D container_of(pdu->s, Xen9pfsDev, state); Xen9pfsRing *ring =3D &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings]; @@ -198,19 +198,16 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pd= u, g_free(ring->sg); =20 ring->sg =3D g_new0(struct iovec, 2); - xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, *size); + xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); =20 buf_size =3D iov_size(ring->sg, num); - if (buf_size < P9_IOHDRSZ) { - xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs reply type %d needs " - "%zu bytes, buffer has %zu, less than minimum\n", - pdu->id + 1, *size, buf_size); + if (buf_size < size) { + xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d" + "needs %zu bytes, buffer has %zu\n", pdu->id, size, + buf_size); xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); xen_9pfs_disconnect(&xen_9pfs->xendev); } - if (buf_size < *size) { - *size =3D buf_size; - } =20 *piov =3D ring->sg; *pniov =3D num; --=20 2.17.1 From nobody Thu Mar 28 20:31:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1590090467; cv=none; d=zohomail.com; s=zohoarc; b=kVPripX0gJzqExCT6dPBafVIZI8jlk5Co4N5o4gOFq/G+YwJsB5kIYk6g+2AJdSsocQfVknRgvEGdGo2qkvNp+lhuYObN0H0j5WMLjfKjLdahWwKEH/YaEAIsh9fC4ww1PyWCFkldkLt6nVbiyE6HU0u2LXGnJX2K89B5czAivQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590090467; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ts6x+GwzzB2zp3jwCox+QM5F1kzK0sGVKcYCFaNfrZM=; b=PzB3/PF+EcNgqMP5fJU/kslNUEClq6CbbrnATdX8JzLxCwNBH2vD7VKtPFCbjbyFZ4Fi3vFecHDdrEWit+Ni5P0NxJileyOPO0pKVxWvayc+hojKyLGsm5kcYPXuYc8np6v8yrkufs1sMXQDJqZAXv4/cTCZm3qsVFBjcdOdGnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590090467104471.2839062863785; Thu, 21 May 2020 12:47:47 -0700 (PDT) Received: from localhost ([::1]:36812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbrAP-0003cJ-Qu for importer@patchew.org; Thu, 21 May 2020 15:47:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqps-0007xW-NT for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:46348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqpq-0002Yq-BT for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:32 -0400 Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B1F1020823; Thu, 21 May 2020 19:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590089189; bh=OLinQC9iMGghSpuw/kVjTtdK+MSS8ybD0n5V6iGg1R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mn2ybyc5RdBn3P9lPA+JIa0Jo3DN94gHiKwtjQptGdwW5ZJqnrLnVXzmvybaAKoEv UzcIWpKiGMXhIgU5G0u9xGmoo+uvNjJN48OxRr5m8L82iYMte3K5x+RN1Oe/YOlJcN P/Rl6hcJ+gHh4IRDkbRX58V8RAehPqMHIlS7ZKsQ= From: Stefano Stabellini To: groug@kaod.org Subject: [PATCH v2 2/3] xen/9pfs: yield when there isn't enough room on the ring Date: Thu, 21 May 2020 12:26:26 -0700 Message-Id: <20200521192627.15259-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.145.29.99; envelope-from=sstabellini@kernel.org; helo=mail.kernel.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 15:26:19 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, paul@xen.org, qemu_oss@crudebyte.com, qemu-devel@nongnu.org, anthony.perard@citrix.com, Stefano Stabellini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-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: Stefano Stabellini Instead of truncating replies, which is problematic, wait until the client reads more data and frees bytes on the reply ring. Do that by calling qemu_coroutine_yield(). The corresponding qemu_coroutine_enter_if_inactive() is called from xen_9pfs_bh upon receiving the next notification from the client. We need to be careful to avoid races in case xen_9pfs_bh and the coroutine are both active at the same time. In xen_9pfs_bh, wait until either the critical section is over (ring->co =3D=3D NULL) or until the coroutine becomes inactive (qemu_coroutine_yield() was called) before continuing. Then, simply wake up the coroutine if it is inactive. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck --- Changes in v2: - add comments on barriers --- hw/9pfs/xen-9p-backend.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index fc197f6c8a..3c84c86ab8 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -37,6 +37,7 @@ typedef struct Xen9pfsRing { =20 struct iovec *sg; QEMUBH *bh; + Coroutine *co; =20 /* local copies, so that we can read/write PDU data directly from * the ring */ @@ -198,16 +199,20 @@ static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pd= u, g_free(ring->sg); =20 ring->sg =3D g_new0(struct iovec, 2); - xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); + ring->co =3D qemu_coroutine_self(); + /* make sure other threads see ring->co changes before continuing */ + smp_wmb(); =20 +again: + xen_9pfs_in_sg(ring, ring->sg, &num, pdu->idx, size); buf_size =3D iov_size(ring->sg, num); if (buf_size < size) { - xen_pv_printf(&xen_9pfs->xendev, 0, "Xen 9pfs request type %d" - "needs %zu bytes, buffer has %zu\n", pdu->id, size, - buf_size); - xen_be_set_state(&xen_9pfs->xendev, XenbusStateClosing); - xen_9pfs_disconnect(&xen_9pfs->xendev); + qemu_coroutine_yield(); + goto again; } + ring->co =3D NULL; + /* make sure other threads see ring->co changes before continuing */ + smp_wmb(); =20 *piov =3D ring->sg; *pniov =3D num; @@ -292,6 +297,20 @@ static int xen_9pfs_receive(Xen9pfsRing *ring) static void xen_9pfs_bh(void *opaque) { Xen9pfsRing *ring =3D opaque; + bool wait; + +again: + wait =3D ring->co !=3D NULL && qemu_coroutine_entered(ring->co); + /* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */ + smp_rmb(); + if (wait) { + cpu_relax(); + goto again; + } + + if (ring->co !=3D NULL) { + qemu_coroutine_enter_if_inactive(ring->co); + } xen_9pfs_receive(ring); } =20 --=20 2.17.1 From nobody Thu Mar 28 20:31:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1590089985; cv=none; d=zohomail.com; s=zohoarc; b=HrlUCaBPxeqTJ6vu697v3M4y7xadYWPMbyH12u+jTzs/fdUt2Zjze7ZqCWbqO8jKZ6mNSYnxWOSJeYZTZbYwA1PG2EKE48ZUbB3ds7U5ltQcYvZtjmxVu4WjWiscV3iP5AR0MInFNA1eMpmqgUx/VWT/9AXgD0rqlGHsNQE3fYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590089985; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=quBGFh536o0W+09vAyzx8MnC6WKnXVSWU142ILSKXAo=; b=XXq157hxv+sIgdWckBK45njAIjqtpX3tcxNGzmUY7pXCubiNOA570kR3v5z+5Xx9PF+vUHBR4UPA+CTG7XnUK6I0pd32i4/Vr27iHYszx/X66n/1FbG4nIYVZtxwTME+fbCB/gL35myh8pBqVJU1G1axjPK0ICd1gvWuMQxipNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590089985784461.1116353385778; Thu, 21 May 2020 12:39:45 -0700 (PDT) Received: from localhost ([::1]:57768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbr2e-0002EG-Cv for importer@patchew.org; Thu, 21 May 2020 15:39:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqpr-0007tJ-Cs for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbqpq-0002Yu-Dy for qemu-devel@nongnu.org; Thu, 21 May 2020 15:26:31 -0400 Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2764B20829; Thu, 21 May 2020 19:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590089189; bh=qth0gZ5xBbaWEKdqHxl0V348J7lsE6oOo/kwx1SoOOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iMyEo7j32pCrxOnF9egdv4Uwx6R32QNKGD+ACg/qr2frOpcD3wK/xz0AgXRoEISsp uI8Z/AtNXF6IFKZ6YxFF5qr/P72r9EywZH/omTw7DbNwRZ5WT+AY8923/rXiBSFkNk bKwPA/c4oO8HacbNFmGHKWpGt1R3BBHWeudOH5oc= From: Stefano Stabellini To: groug@kaod.org Subject: [PATCH v2 3/3] xen/9pfs: increase max ring order to 9 Date: Thu, 21 May 2020 12:26:27 -0700 Message-Id: <20200521192627.15259-3-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.145.29.99; envelope-from=sstabellini@kernel.org; helo=mail.kernel.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 15:26:19 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, paul@xen.org, qemu_oss@crudebyte.com, qemu-devel@nongnu.org, anthony.perard@citrix.com, Stefano Stabellini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-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: Stefano Stabellini The max order allowed by the protocol is 9. Increase the max order supported by QEMU to 9 to increase performance. Signed-off-by: Stefano Stabellini Reviewed-by: Christian Schoenebeck --- Changes in v2: - patch added --- hw/9pfs/xen-9p-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index 3c84c86ab8..a969fcc54c 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -21,7 +21,7 @@ =20 #define VERSIONS "1" #define MAX_RINGS 8 -#define MAX_RING_ORDER 8 +#define MAX_RING_ORDER 9 =20 typedef struct Xen9pfsRing { struct Xen9pfsDev *priv; --=20 2.17.1