Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6773304rwb; Wed, 18 Jan 2023 09:10:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuGBTKeWuxj8Y0ISzQLXrzEdTiTT6uiQoXIqwIcZ0pKiSiApJyPSB5digLArBjciwOH1w7h X-Received: by 2002:aa7:de9a:0:b0:482:d62c:cde with SMTP id j26-20020aa7de9a000000b00482d62c0cdemr21242044edv.13.1674061823430; Wed, 18 Jan 2023 09:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674061823; cv=none; d=google.com; s=arc-20160816; b=h0Nr+3tQ4dB3XRf5k52c61+gAweCxUIhk7xAimMm+gleMPyFQH50roUI6By+D4IRuN 6Q+ukCVGVHtfiUuVt9Yr3eFiSscAH286k4OqvM3fypc5mWNLOlfyq5TkIpJyknb01CJg oV8zS0Jf5HWB5lrziyCh4SWlssreytUAisZg+R1BawnIR2/cLrS/PTwgb74NX3rU6oWH oCNK3r1cH/anaQvArbq1GTO9ffKUzrLL/0loScR0OJrg4jJilejvzRlRfrCtRyjlixCy tfTf/tprxojJTTg0mEKq24QRRxRECLAKR/2PwU9jhMPC1vxagBZqxjrOaQhW0VffAoh0 GwKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fCDpJ99OAg1IiFvWVbDolIfYU7fU7hPLAuBJ/mgUf8E=; b=jxTkUKexjtJoo/T8AhRCjk8HO4sjXhOsz+zXCmzcYRGC1uoHqAvDFbpn570jTfp7Ts ZdgYSYWH/nH7o3bxNL274IqZVCln63CjHS2utDfbuqUrs6ZopGXt/ATMK54f2erZBt84 2b7zM/l9vs9NzVpB/rcrT8LLumGb3MBzAp8K5TG0kfpfUGZhkIWOUm3bBlGkLVe6T/tK cJLuGeDA445TvPFHSyAFZJNihmHfHFFLArAjMAFDEWiAAyEg30r5k9xMB8LT/A0JZIQx ZA+1pldLqkbc1acXSE4mSQ5NNvUrcXw6lNVl4awASkfTMtHkK8M/BEaVnLGr0cpBF3gt mJgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TlpSQ1xt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a056402040400b0049e1bc53bd3si8499191edv.486.2023.01.18.09.10.12; Wed, 18 Jan 2023 09:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TlpSQ1xt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjARQpk (ORCPT + 47 others); Wed, 18 Jan 2023 11:45:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbjARQpN (ORCPT ); Wed, 18 Jan 2023 11:45:13 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D2AF56EC4 for ; Wed, 18 Jan 2023 08:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674060247; 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; bh=fCDpJ99OAg1IiFvWVbDolIfYU7fU7hPLAuBJ/mgUf8E=; b=TlpSQ1xtdkTvVsbEvP9Cc5m6+bAYqTXkRptfDHqPai2A9F82FZdaRQfMtrp3cqrG7lz6Zv HuyhKHVuw1RNehq2rl3mJjvjcGRM9lXZMgXD0wO4+Ctrh3ZIqsU1cGD1FUpV/r8I5sRwtg yr0rZPem8px52El4U3cdhsFd0VWCtyw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-64-iMvvI5XLM1WcD9VqHzw9Jw-1; Wed, 18 Jan 2023 11:44:04 -0500 X-MC-Unique: iMvvI5XLM1WcD9VqHzw9Jw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99AA11871DA5; Wed, 18 Jan 2023 16:44:03 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E932140EBF6; Wed, 18 Jan 2023 16:44:01 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: mst@redhat.com Cc: leiyang@redhat.com, Laurent Vivier , sgarzare@redhat.com, jasowang@redhat.com, Zhu Lingshan , virtualization@lists.linux-foundation.org, si-wei.liu@oracle.com, linux-kernel@vger.kernel.org, lulu@redhat.com, Gautam Dawar , alvaro.karsz@solid-run.com Subject: [PATCH 0/2] Fix expected set_vq_state behavior on vdpa_sim Date: Wed, 18 Jan 2023 17:43:57 +0100 Message-Id: <20230118164359.1523760-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The use of set_vq_state is to indicate vdpa device the state of a virtqueue= .=0D In the case of split, it means the avail_idx. This is mandatory for use=0D cases like live migration.=0D =0D However, vdpa_sim reset the vq state at vdpasim_queue_ready since it calls= =0D vringh_init_iotlb.=0D =0D Also, to starting from an used_idx different than 0 is needed in use cases = like=0D virtual machine migration. Not doing so and letting the caller set an avai= l=0D idx different than 0 causes destination device to try to use old buffers th= at=0D source driver already recover and are not available anymore.=0D =0D This series fixes both problems allowing to migrate to a vdpa_sim_net devic= e.=0D =0D Eugenio P=C3=A9rez (2):=0D vdpa_sim: not reset state in vdpasim_queue_ready=0D vringh: fetch used_idx from vring at vringh_init_iotlb=0D =0D drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 ++=0D drivers/vhost/vringh.c | 25 +++++++++++++++++++++++--=0D 2 files changed, 25 insertions(+), 2 deletions(-)=0D =0D -- =0D 2.31.1=0D =0D