Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp607101rwb; Thu, 11 Aug 2022 07:07:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/DryWkoS6f3ZTdfFk0QqJcDdI9R2ruaKFAu6B7+mIkXqNcEqhSwLsgQMYR9cgRvBv4Oat X-Received: by 2002:a17:906:8a4e:b0:730:9fcd:d988 with SMTP id gx14-20020a1709068a4e00b007309fcdd988mr24028566ejc.636.1660226875968; Thu, 11 Aug 2022 07:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660226875; cv=none; d=google.com; s=arc-20160816; b=US8H8i+lqARgOwkhksguonVd0STAezMVzzieeNSmbKqj96l9VHFUJmlqMWHUeC8YRv gqRsu+ehAgx+xUOh8u0gzTKWj5TdoMKyixm+wp7A90ccJ1J4DivkcAAAxTBNZKqy7pRw SwRNqoFpZIX+2b1WtFhCYAHF2pYOoL6gQllSDZ23oOy1vuelnmSjYtxQdjuaY+FrrGUz iiuuW4jZNGwP+MalzGViMPH3iLDHFDfQH9DociwYDReU7//fffDxjdvQ070lt/++K90f L9Z00l4C39zuNWgVmXmwOe14EMcGWed2f9/5WM4I7Kbud1nlMICBMKqJ2dpUZcfDF4f8 gc4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SueXoUwoFpOiUowzXaYPSnSZQFBzpony+oQ+FoIu3TE=; b=W7vLPDrjEP7lOX+pv9lcsGrvCixgfxOlUGH/IDwC3NRradlkei0feDrz3/kR3MkbkT Aausl97Z8LwXoUpj0SwQo06g3Osjt6utziEHqyjlVRpJndGHIF9G1r6Xl1S2bQfrOrd4 QWP0YBGdzAgC95FrN1vYkA8Uj7HJ/2M7ZSKqj/PKGWt8zGKd/pCYVAwZy3JuM9RD0xze Wm1TgIF4TqqrZZqT8kihmWpgavZbaUMz1bRAIUkZJZtIlOwZw2xpPHEwj88XqCkT8euu yIR5Z5hK6k4dqhZSnji/y/EhJ4KKR7pdVQ01HGB0gtMVulp+KJk0UpHU7+CgiO8n48/k o0OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dw35X9gJ; 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 c18-20020a05640227d200b0043be773a90dsi16152953ede.45.2022.08.11.07.07.29; Thu, 11 Aug 2022 07:07:55 -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=dw35X9gJ; 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 S235351AbiHKN6j (ORCPT + 99 others); Thu, 11 Aug 2022 09:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235314AbiHKN6h (ORCPT ); Thu, 11 Aug 2022 09:58:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C1D5D82755 for ; Thu, 11 Aug 2022 06:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660226315; 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=SueXoUwoFpOiUowzXaYPSnSZQFBzpony+oQ+FoIu3TE=; b=dw35X9gJFH8Mvqd3WiQbTYSYR3fsaH31uu1sFp9v6oZ0GedYpE47x0xAKe+rWs8m2NYANd PGQJbIznHfC9GemeYPaCRsEMDow6pB9FP+/lNJysm1ksT3OmH7cakKrY9DdODS6SFvmJod AKPGE03qUSmYSUXQMMapOdm+JQ33s18= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-78-AUTxff9ZNkunE18KLQQ-tQ-1; Thu, 11 Aug 2022 09:58:34 -0400 X-MC-Unique: AUTxff9ZNkunE18KLQQ-tQ-1 Received: by mail-ed1-f70.google.com with SMTP id m18-20020a056402511200b0043d601a8035so11200808edd.20 for ; Thu, 11 Aug 2022 06:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=SueXoUwoFpOiUowzXaYPSnSZQFBzpony+oQ+FoIu3TE=; b=JIxqLM7jLf75EnMek3AaPO0Ajd7RzHqs56Btiy8gHQkUIWG8owFkeJmgCTswhRZXD+ d2cgjOKeQmr/vUrfdvFdgOy9eyPQ/APmpVq0IWsfKHzGt4v5+kuN3oZiAyDYNt7ROz28 N/BWp+/K2TYwdEO0GhrwAPKzSeOw8630MWqH+A3XZZRw5PrMqz8S89mtxUyqZEF0VLrP zNvRE/PjSwn+72wdGC6o0hTZch3sXGszEnGBnmfF/2wkpRIrEPWxKqhKznbY/hXngKSX AGEtsm8lKm72ZKgEucPdkMU4lOL21/gOqCy9J7roAgDCBTFz5B7PuL8528CFkslSrkZC Q1Tw== X-Gm-Message-State: ACgBeo1lvpSZPRS5y7RPCd9wydwM+6zv6L7rgi3DADjUX1ONaC7uZeJv tpYWH0dOtyMZ7ycASXGAabBRybY9zEgOJBczO7p7AF6mFOlnf3Gm9mRD/gtY/CxTvbZd+RtYonG qB5O4PVY3XTSuZpnaN3ZoQtO5 X-Received: by 2002:a17:907:a0c6:b0:730:f081:6e8e with SMTP id hw6-20020a170907a0c600b00730f0816e8emr21391784ejc.479.1660226313546; Thu, 11 Aug 2022 06:58:33 -0700 (PDT) X-Received: by 2002:a17:907:a0c6:b0:730:f081:6e8e with SMTP id hw6-20020a170907a0c600b00730f0816e8emr21391746ejc.479.1660226313014; Thu, 11 Aug 2022 06:58:33 -0700 (PDT) Received: from redhat.com ([2.52.152.113]) by smtp.gmail.com with ESMTPSA id a1-20020a50ff01000000b0043a5bcf80a2sm9166980edu.60.2022.08.11.06.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 06:58:32 -0700 (PDT) Date: Thu, 11 Aug 2022 09:58:25 -0400 From: "Michael S. Tsirkin" To: Eugenio =?iso-8859-1?Q?P=E9rez?= Cc: virtualization@lists.linux-foundation.org, Jason Wang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, 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: Re: [PATCH v8 0/3] Implement vdpasim suspend operation Message-ID: <20220811095743-mutt-send-email-mst@kernel.org> References: <20220811135353.2549658-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220811135353.2549658-1-eperezma@redhat.com> X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Thu, Aug 11, 2022 at 03:53:50PM +0200, Eugenio P?rez wrote: > Implement suspend operation for vdpa_sim devices, so vhost-vdpa will offer > that backend feature and userspace can effectively suspend the device. > > This is a must before getting virtqueue indexes (base) for live migration, > since the device could modify them after userland gets them. There are > individual ways to perform that action for some devices > (VHOST_NET_SET_BACKEND, VHOST_VSOCK_SET_RUNNING, ...) but there was no > way to perform it for any vhost device (and, in particular, vhost-vdpa). > > After a successful return of ioctl the device must not process more virtqueue > descriptors. The device can answer to read or writes of config fields as if it > were not suspended. In particular, writing to "queue_enable" with a value of 1 > will not make the device start processing virtqueue buffers. > > In the future, we will provide features similar to > VHOST_USER_GET_INFLIGHT_FD so the device can save pending operations. > > Applied on top of vhost branch. > > Comments are welcome. > > v8: > * v7 but incremental from vhost instead of isolated. Now I'm lost. incremental to what? Does the vhost branch now have the correct bits? > v7: > * Remove ioctl leftover argument and update doc accordingly. > > v6: > * Remove the resume operation, making the ioctl simpler. We can always add > another ioctl for VM_STOP/VM_RESUME operation later. > * s/stop/suspend/ to differentiate more from reset. > * Clarify scope of the suspend operation. > > v5: > * s/not stop/resume/ in doc. > > v4: > * Replace VHOST_STOP to VHOST_VDPA_STOP in vhost ioctl switch case too. > > v3: > * s/VHOST_STOP/VHOST_VDPA_STOP/ > * Add documentation and requirements of the ioctl above its definition. > > v2: > * Replace raw _F_STOP with BIT_ULL(_F_STOP). > * Fix obtaining of stop ioctl arg (it was not obtained but written). > * Add stop to vdpa_sim_blk. > > [1] git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git > > Eugenio P?rez (3): > vdpa: delete unreachable branch on vdpasim_suspend > vdpa: Remove wrong doc of VHOST_VDPA_SUSPEND ioctl > vhost: Remove invalid parameter of VHOST_VDPA_SUSPEND ioctl > > drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 ------- > include/linux/vdpa.h | 2 +- > include/uapi/linux/vhost.h | 17 ++++++----------- > 3 files changed, 7 insertions(+), 19 deletions(-) > > -- > 2.31.1 >