From nobody Tue Feb 10 00:58:42 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576762498; cv=none; d=zohomail.com; s=zohoarc; b=OpZ2Vt9BJHSyT68hI9ry4a05DN/Ef79CWiwhDNZ7rCoCP65tNcw76G6KSOPWRC6VXiDTkngx6DFrfJkhxwUioOdLj2nfFj4VtHfAKKgDJrU8yfWcWJJTrzmv8IPNbbT6kZRfh3mMwyMj69gF/4XpNXduI3YRJp8543LzpLovdeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576762498; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zj2wVrIh8KQNhFA65bESMfJP7roYgy+mFo3n5QglPhQ=; b=TxuEJivjmFvNuidnY28HVAJvy+btJEBsNLzeQI3u81zfCNHVm9RWP7ThvO8hqnVZtLkgT5CKbBsiRgeyZHtqRbLA1i1sXyDrdftdfN/zGX9qtJejqwiO1tWYnIpptGHG8VEpd5BBxCnN9wLndVFZantOjjA7dB3IlRD+vALS1og= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1576762498793466.5868714758665; Thu, 19 Dec 2019 05:34:58 -0800 (PST) Received: from localhost ([::1]:41590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihvxB-0001mE-4V for importer@patchew.org; Thu, 19 Dec 2019 08:34:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51735) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihvq3-000185-Uy for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:27:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihvq2-0003f9-T7 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:27:35 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31228 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihvq2-0003cQ-Mn for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:27:34 -0500 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-4BquQgKdOXqGIWJJ4J27Fg-1; Thu, 19 Dec 2019 08:27:33 -0500 Received: by mail-qk1-f199.google.com with SMTP id 12so3575745qkf.20 for ; Thu, 19 Dec 2019 05:27:33 -0800 (PST) Received: from redhat.com (bzq-79-181-48-215.red.bezeqint.net. [79.181.48.215]) by smtp.gmail.com with ESMTPSA id g53sm443675qtk.76.2019.12.19.05.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 05:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576762054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zj2wVrIh8KQNhFA65bESMfJP7roYgy+mFo3n5QglPhQ=; b=HwhU+lhSzy2xJNfzn8StHrNOmV2fplVMQYJCl7Xi9Dt09g0/TVW1ofpoUIDfT3QMqjy0uT tFOOGWs7WJlgHQyNg9QL9o3H59yyPTwhmMYD21mcTF0ROAg4n4WzTHuqAFSt+qI6oOKjT9 Rf8y3lk+USaAVmkUjVPVlw84wcINkjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=sanExUpcAf7TPhNumiJmyXjhA8u9u6QpSUASPDnjn/0=; b=jTCSfoNiPHPfVs68xEs9ttEAyVA9pM8uWmvIaPbL7YYT+FDiCd2EJHQUlkuEwvWLNM yUPFS7W2dX5XfN1a9eoHqTkxszEzp1Mct1AdB2mSxL4DhlsHNcsjt0YeU04VVOPpfcy6 enq4hzqlSU4FJuMpCEzyrwxbVFOl/lYE0v9Gr3rMrlfGiVm9kP1PEURC0bRmLXnjVRAx r0RT8YoutQyF+fVX2HyQvvx0Fs9mZCZ/Z6s7WkagF/VNPDea2ejHquQyWMFKkjuZW8Qp KHlVSd0IjASY++ccfAiqQiWcbQxd+jTzH0qDFJHNTquPY3qE7in9G89oCI+Cqq9jnezW 0KEQ== X-Gm-Message-State: APjAAAUDSo5tXs9uQXaBPfrng+o8LAK/1sqQZ8TNyNHwB9X+UtU/zkRS g+NjjgnavbkV8yAyxml+jroXAcqvDgzJmPydViuatWaVq2SvGSB9XbrXGvxeQ3TImUdftmHTQxB wAioaDh1yg4nTDJY= X-Received: by 2002:ac8:709a:: with SMTP id y26mr7000067qto.304.1576762052420; Thu, 19 Dec 2019 05:27:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzkA5yqJEFgrmZxI0g2Lrazb3uSDg2jMPT3Sp/NwzeIe2D+Z8sQlqs1fSN/YO0FvJGnFVn9MQ== X-Received: by 2002:ac8:709a:: with SMTP id y26mr7000056qto.304.1576762052277; Thu, 19 Dec 2019 05:27:32 -0800 (PST) Date: Thu, 19 Dec 2019 08:27:28 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 07/24] virtio: update queue size on guest write Message-ID: <20191219132621.16595-8-mst@redhat.com> References: <20191219132621.16595-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191219132621.16595-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-MC-Unique: 4BquQgKdOXqGIWJJ4J27Fg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Some guests read back queue size after writing it. Update the size immediatly upon write otherwise they get confused. Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c6b47a9c73..e5c759e19e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1256,6 +1256,8 @@ static void virtio_pci_common_write(void *opaque, hwa= ddr addr, break; case VIRTIO_PCI_COMMON_Q_SIZE: proxy->vqs[vdev->queue_sel].num =3D val; + virtio_queue_set_num(vdev, vdev->queue_sel, + proxy->vqs[vdev->queue_sel].num); break; case VIRTIO_PCI_COMMON_Q_MSIX: msix_vector_unuse(&proxy->pci_dev, --=20 MST