Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp593134rwb; Thu, 11 Aug 2022 06:57:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w3EtTE9P5re+ZbXsp57CO754R9ixkyTF5e0D6hxtr2VfPQDcyxIENVsmqKbHQ1GMmkpSK X-Received: by 2002:aa7:ccc4:0:b0:43d:9e0e:b7ff with SMTP id y4-20020aa7ccc4000000b0043d9e0eb7ffmr31462351edt.14.1660226271991; Thu, 11 Aug 2022 06:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660226271; cv=none; d=google.com; s=arc-20160816; b=tWvnHWmqxpcHWE7zQn8kfArrVwyz4IrkEPXeus6+slb6+x+DWchwwRQDr/U3iWDBTQ E3JP74KE8b20tU4B/L+ZJQ8EBqj8vWj60Fzlfn4yvV9+MdZN/ep9Cdq3IA2gUY+juvC5 kZFoTHtDtiypwIdjVLqLtkr1wMXDQ3kSANtb3pIjEVdXblMMhNJOkyDYpCYNk1AF3Yc7 NRg2jwuIpWUi1fPixbMWmq99yBKSWh6yyIbTlPwcz54Rpq/buPH3PgcyKOxk40fSWH/t kxxjetJcbB1I9o+7milXeyqyi6uZpHBOxY47a/2+63A05FSWYsR/MURatMsXcxLqlG2n 2mtA== 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=5kJeSSsfCq2FY3f7RK2Q/BBcFFU0NepVqdZJEXZ6UQI=; b=E1l6nUttlDut5SG7yn9xK5DP25HIBwBtH7iWstjQNt7JfKxB1cUbTTutocRaOaKhFJ AkXLQOOmQvsg8OeF3q9AkfqQLaoaot1BOsRBpZpvZkQconQMtoAHMTOPR+QQcLSlI9To Bj56/kkZPs7qM+6fCmUnJpbS/mlEfsllSha2AmHiyN3EjX5G1nR+qJ31l+RUu9ISWyw4 8XiBAw+em3H2lqcLV51QJYXgxGUCYtk6qXGX7IARzkBF7+Nyy26qKVoryjx0biZmaXae uSaZ8Myx41T7KQkaMHH5hTAzDxUsxK9kfVBLGx/z/bc81sPkf0nMXZ2hBngQzb7z6p8d SIMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VEU+2uFM; 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 gt36-20020a1709072da400b00730822632e8si8933016ejc.535.2022.08.11.06.57.24; Thu, 11 Aug 2022 06:57:51 -0700 (PDT) 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=VEU+2uFM; 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 S235180AbiHKNyN (ORCPT + 99 others); Thu, 11 Aug 2022 09:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234945AbiHKNyI (ORCPT ); Thu, 11 Aug 2022 09:54:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5985D642E5 for ; Thu, 11 Aug 2022 06:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660226045; 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=5kJeSSsfCq2FY3f7RK2Q/BBcFFU0NepVqdZJEXZ6UQI=; b=VEU+2uFMXEYWaevK4Rp/+DzXLnBHMTLnyYNoUYTijZclVarc7UrMdIj9B+9Vf7nqCIU0TU wBuRicTjvLoaG1dx+iVLSOLZ4mXnyk0ITHQFbQ3QM+0Kth1IUvJ20q/tea52U3F33eoFQ3 ZEn4cKhBN6Rqal/oSVnJEL76ttHn4hY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-FQ17yzFNMV-zJv8IcbJuMg-1; Thu, 11 Aug 2022 09:54:03 -0400 X-MC-Unique: FQ17yzFNMV-zJv8IcbJuMg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 87E2C1C04B6E; Thu, 11 Aug 2022 13:54:02 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE41640D2827; Thu, 11 Aug 2022 13:53:55 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: virtualization@lists.linux-foundation.org, Jason Wang , "Michael S. Tsirkin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: ecree.xilinx@gmail.com, gautam.dawar@amd.com, Zhang Min , pabloc@xilinx.com, Piotr.Uminski@intel.com, Dan Carpenter , tanuj.kamde@amd.com, Zhu Lingshan , martinh@xilinx.com, Christophe JAILLET , lvivier@redhat.com, martinpo@xilinx.com, hanand@xilinx.com, Eli Cohen , lulu@redhat.com, habetsm.xilinx@gmail.com, Parav Pandit , Longpeng , Wu Zongyong , Si-Wei Liu , Stefano Garzarella , dinang@xilinx.com, Xie Yongji Subject: [PATCH v8 0/3] Implement vdpasim suspend operation Date: Thu, 11 Aug 2022 15:53:50 +0200 Message-Id: <20220811135353.2549658-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Implement suspend operation for vdpa_sim devices, so vhost-vdpa will offer= =0D that backend feature and userspace can effectively suspend the device.=0D =0D This is a must before getting virtqueue indexes (base) for live migration,= =0D since the device could modify them after userland gets them. There are=0D individual ways to perform that action for some devices=0D (VHOST_NET_SET_BACKEND, VHOST_VSOCK_SET_RUNNING, ...) but there was no=0D way to perform it for any vhost device (and, in particular, vhost-vdpa).=0D =0D After a successful return of ioctl the device must not process more virtque= ue=0D descriptors. The device can answer to read or writes of config fields as if= it=0D were not suspended. In particular, writing to "queue_enable" with a value o= f 1=0D will not make the device start processing virtqueue buffers.=0D =0D In the future, we will provide features similar to=0D VHOST_USER_GET_INFLIGHT_FD so the device can save pending operations.=0D =0D Applied on top of vhost branch.=0D =0D Comments are welcome.=0D =0D v8:=0D * v7 but incremental from vhost instead of isolated.=0D =0D v7:=0D * Remove ioctl leftover argument and update doc accordingly.=0D =0D v6:=0D * Remove the resume operation, making the ioctl simpler. We can always add= =0D another ioctl for VM_STOP/VM_RESUME operation later.=0D * s/stop/suspend/ to differentiate more from reset.=0D * Clarify scope of the suspend operation.=0D =0D v5:=0D * s/not stop/resume/ in doc.=0D =0D v4:=0D * Replace VHOST_STOP to VHOST_VDPA_STOP in vhost ioctl switch case too.=0D =0D v3:=0D * s/VHOST_STOP/VHOST_VDPA_STOP/=0D * Add documentation and requirements of the ioctl above its definition.=0D =0D v2:=0D * Replace raw _F_STOP with BIT_ULL(_F_STOP).=0D * Fix obtaining of stop ioctl arg (it was not obtained but written).=0D * Add stop to vdpa_sim_blk.=0D =0D [1] git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git=0D =0D Eugenio P=C3=A9rez (3):=0D vdpa: delete unreachable branch on vdpasim_suspend=0D vdpa: Remove wrong doc of VHOST_VDPA_SUSPEND ioctl=0D vhost: Remove invalid parameter of VHOST_VDPA_SUSPEND ioctl=0D =0D drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 -------=0D include/linux/vdpa.h | 2 +-=0D include/uapi/linux/vhost.h | 17 ++++++-----------=0D 3 files changed, 7 insertions(+), 19 deletions(-)=0D =0D -- =0D 2.31.1=0D =0D