From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FEE5606A322 for ; Thu, 3 Dec 2026 14:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S2e0H+RO; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=lH+1/JYt Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZ7eK-00039y-NO; Thu, 03 Dec 2026 09:19:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZ7e7-00031w-Gq for qemu-devel@nongnu.org; Thu, 03 Dec 2026 09:18:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZ7e5-0002w7-DA for qemu-devel@nongnu.org; Thu, 03 Dec 2026 09:18:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796307528; 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: in-reply-to:in-reply-to:references:references; bh=/vob8WcXttYJg8KwXEuBga/GexZfjC06TfnhyTMpgXY=; b=S2e0H+RObfm2oPf+e5QYDKISdNM0TtzwYmOOsloj21AXwAn1zYO7Z6K67mDNOPBKG/Vkam vlOizSgDCNX4gxBvNK0PSFBa0giDZPZeGjbNU3+CnPH9LV+v2zH+Gg6JL3oOkRwLzlOq/B 8Ssy0XTEKybZNu159xwPmqELR7zU92g= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-OoTJx1nBM0GdKxecERjkaQ-1; Thu, 3 Dec 2026 14:18:45 +0000 X-MC-Unique: OoTJx1nBM0GdKxecERjkaQ-1 X-Mimecast-MFC-AGG-ID: OoTJx1nBM0GdKxecERjkaQ_1796307524 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-3afe56c776bso6071481fa.1 for ; Thu, 03 Dec 2026 06:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796307523; x=1796912323; darn=nongnu.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/vob8WcXttYJg8KwXEuBga/GexZfjC06TfnhyTMpgXY=; b=lH+1/JYt/WCO4PclhcwYeqEVID491W5AGWsy08WLmvmeyco3kthL9rG7ibV0GYraBC 6W48pNSAqauBbjz/g16ubXMC4Om31MxuKZmSZ6N3VRWCw3g3Pk8/O/SteKhnxUG6GCyL 3AHPy7WCwFh0Q3ihWLJXyFHhEqaD1rGPbRBZak2MWyUqMkdwWsFBRBhfD1Z8x8Pavqtw LKlcXiiUpxSUnI/VDIAgEqkviZ49fdz7sLyemrJ+AryvpS09wkgAa6SvHdX9OJmrRBv3 OQVvzBf963fWLALAyfO710FWPWSaRUL/WHad+EqBo87Bwk4l/nYatJJbitUHvZdEVKS8 qr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796307523; x=1796912323; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/vob8WcXttYJg8KwXEuBga/GexZfjC06TfnhyTMpgXY=; b=TKAgYMS6b/q+fzEQUEiFids1P+7/BRssryGIikAc/+6eP+hQ3MB6AH6y+B1g6ZYIq0 UryvEm52esGwD3MbBhyaX9OA5Zfd8Dkj+m0rXq+5IdtHtb3bdczjMTPFtGgPLrXQR6MU UQc3Wf1ExlKB8Bv3STqUvbiTitV7qtitWMLdxMbxAGbx9oqVd9LYWUkUCJR2/kPkmxh9 InrGQA6BwRulO+7f9R0KGG/ZG9CPvU0kpFauGjVw5y7p4Zpc3HGmnRH2LXrkQHwEOx6c AEUEm9rwpc6ZE5l+NSOTyy+h1Yo7HXubfznWKkqb6P1hPifbs5pYh4mYDXBq6bzGcUpG ErDg== X-Gm-Message-State: APuU4Z9LZUxgtbvVij1gqQflxnK6dfNKmKtnYNVgEHRLMutK+Zw8rwFt rsxPuRESJnFCPGuynJViAxt8eAJILB8rEUXpvzWj8hoRIqUM2a69TWYKAiEVfquJHTLcLtFLi06 XHX1MZVkGdWWBk7Q+ksBcjmBREU4/Et2QrOCmjv5DL6BQiKhTKqScns3C X-Gm-Gg: AZFdTZfMXNFDzH0p2vZXSbZpnk8qUgvpzhfbu90BAtxl1mce4WGa0ignjCPMfk7SHxp mX7aynuytRKriEfLw6JljAu8zAXTkefp8LOfMeA3SAUq2B/T/YYpaWzw2ozbkb0HYWP9YFW/ZuP 9MzESWV3H9Ys6mPt4/MRthPSrJ8pwTJa5GTNvVZoqJ2ojOPT0eEnTzDPeQqA2LLzO9AvpN2v12o ZudJ+KP27qdr1qguRVPOKQ1PSbC2gImweG9bCH8kqHmhNN0nhVn9JaGptAaPEhIgDS8ows0IqBc 89J5vAeCrv8OBcslc7CP0ZsxSuEG1IKhhCtZ6yLsGdjSjDyWBocIVyP1WriECxqCZTgdjODSVKp jtQNmlZmrPdHMusNwPXoNwYX7Evs8q+djt/EshzgmqQ== X-Received: by 2002:a05:6512:2305:b0:5c1:7c6a:ff0b with SMTP id 2adb3069b0e04-5c379893571mr616841e87.9.1796307523379; Thu, 03 Dec 2026 06:18:43 -0800 (PST) X-Received: by 2002:a05:6512:2305:b0:5c1:7c6a:ff0b with SMTP id 2adb3069b0e04-5c379893571mr616833e87.9.1796307522684; Thu, 03 Dec 2026 06:18:42 -0800 (PST) Received: from redhat.com ([2a0d:6fc0:153a:4c00:6468:7acf:febf:a046]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c1bd0176fcsm10449433e87.34.2026.12.03.06.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 06:18:41 -0800 (PST) Date: Thu, 3 Dec 2026 09:18:39 -0500 From: "Michael S. Tsirkin" To: Michael Tokarev Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org, Peter Maydell , Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= Subject: Re: [RFC PATCH] virtio: compensate for incoming migration of virtio queues from broken stable series Message-ID: <20261203091800-mutt-send-email-mst@kernel.org> References: <20261203131137.3127943-1-mjt@tls.msk.ru> <20261203085900-mutt-send-email-mst@kernel.org> <7e5cbb67-ef1e-4316-b41f-73d30edd85e1@tls.msk.ru> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e5cbb67-ef1e-4316-b41f-73d30edd85e1@tls.msk.ru> Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, Dec 03, 2026 at 05:08:29PM +0300, Michael Tokarev wrote: > On 12/3/26 17:02, Michael S. Tsirkin wrote: > > On Thu, Dec 03, 2026 at 04:11:37PM +0300, Michael Tokarev wrote: > > > Commit fbb87b0d358a "virtio-mmio: fix QUEUE_NUM_MAX" (v11.1.0) > > > increased queue sizes for virtio-mmio device for older machine > > > types to 1024. This commit were back-ported to older stable > > > series (v10.0.13 and v11.0.5) incorrectly, increasing queue > > > sizes not just for virtio-mmio but for all virtio devices. > > > The result is that for non-mmio virtio devices with queues, > > > migration from these broken versions to curren fails, since > > > the destination expects smaller queue than 1024. > > > > > > Instead of making queue size tied to type of device and > > > machine version, we can reallocate the queue at the load > > > time to match the source. This way, there's no need to > > > have fbb87b0d358a to compensate for the original bug either, > > > as the queues will be adjusted on load. > > > > > > Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/5042 > > > Cc: qemu-stable@nongnu.org > > > Signed-off-by: Michael Tokarev > > > > Fun times. And then people will complain that incoming > > migration can cause dos by drinking up unlimited memory. > > If we really have to, let's put this behind a machine > > compat flag that will just trigger for the broken > > machines. > > This is exactly why I put a check for initially empty queue. > In 10.0.13 and 11.0.4, *all* virtio queues are allocated with > 1024 entries at qemu startup already. And this is why I asked > for the amount of damage - how much is that, currently? > > But yes, it was my first thought too, to limit this to some > machine versions (11.1 and 10.0), or at least to <11.1. The > only prob is that I dunno how to do this properly :) > I have > your example though, and can try to go from there. > > Thanks, > > /mjt Compat property, as usual. -- MST