Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp189765rwb; Wed, 10 Aug 2022 22:47:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MyeFv4GJZY+LALMeACJNqRwHZoO94wScomD1ChGfuka75ARD0fyZ3suofTQpLd/jtlz10 X-Received: by 2002:a05:6402:5247:b0:43e:cf46:45b3 with SMTP id t7-20020a056402524700b0043ecf4645b3mr27532564edd.153.1660196860063; Wed, 10 Aug 2022 22:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660196860; cv=none; d=google.com; s=arc-20160816; b=EHWlVp3I6tn+GsQSx5UT/6DZ0v72fNrQqsFulRnewOIQBHtPInSN/9CK7NIhvYuutV ElzEbaUVAveofqRQuhA5yNW5HY3VxPL0WPgkm6nQFcuhEfabOxKGSJR4iFCbDxvstH8/ WZnEIT/L6xO/BJWCJtbt0AfdgmrqF/lsclYOvCK6i5Lr9L7YhG4xH/NEA8EmZnqSs3CQ 7WvCb59x4Oik3j5izp6+5Xrp6j11qoJH9IJKrZQB2VVGBffNT6o3b7pNp51yX1M4FM9I +NnYKpbLghx3nsQH8gUl3qEfTpl2E7qWn03ztF0XCYM3QSbsKEL4IiZHjaht0YULVk+w 1AOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1PCUDSqmLKN2Mlp7gJOvD0wMAFZjw97KA+2ssjA/d5A=; b=Z0qR1xW+/UOPlyFbYFo2H79KtwgA/5RfU7gEitDhpuCC33tLKYgxv0Mo5v/oMdKnzQ tYjljLL324RmJ639wm4MtWVC4lGAgyIOkA4AND7FRnxY6nTlZDG5xEO1Q5ZLT32Avxp3 oy8b+hN1aX8IW4m1/RwZP4B9EDxoyjQH5TkFwHgGHrpQSqqj3OYNEbrS9ooctBlCO9FO 2Q2HdixivRdd1LQSFNlALwNvKKhP5lA/360mU53LuA9448fVSg3fqqBFORkGL7oI0ctu ecXVH7HthgZ2n9OMIBwzlq+jHZyZMU9hG5gzTVjEe0ypxRa+1V5KYxW6pnw8/BTopJe9 IxQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AKETq6hR; 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 hg2-20020a1709072cc200b00726d5d59195si6892248ejc.674.2022.08.10.22.47.15; Wed, 10 Aug 2022 22:47:40 -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=AKETq6hR; 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 S234008AbiHKFgE (ORCPT + 99 others); Thu, 11 Aug 2022 01:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233517AbiHKFgB (ORCPT ); Thu, 11 Aug 2022 01:36:01 -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 3B778165AB for ; Wed, 10 Aug 2022 22:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660196159; 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=1PCUDSqmLKN2Mlp7gJOvD0wMAFZjw97KA+2ssjA/d5A=; b=AKETq6hRC+MpzLUhdZkgVgmGYxQ79LTtqDJXRP/ATanl06xhVGnVZZyEyL/pNJ9rlDqxUU p2mwvqWSd0v3iKp1H9CVSh8N590w7b4rO0GB9ETgtR/cIOoX/2bkMO87wsmhdPFv7lGOsP miqzZvxccd7SSbY5ap8lhooiop/klNY= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-WW4Yj7rsONCFpBi4EMTIrA-1; Thu, 11 Aug 2022 01:35:58 -0400 X-MC-Unique: WW4Yj7rsONCFpBi4EMTIrA-1 Received: by mail-qk1-f198.google.com with SMTP id ay44-20020a05620a17ac00b006b9945fe7c8so4090519qkb.10 for ; Wed, 10 Aug 2022 22:35:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=1PCUDSqmLKN2Mlp7gJOvD0wMAFZjw97KA+2ssjA/d5A=; b=At8laXNqIcUUyTnani4QkDm1gLN2ehpGo1PNGbMmdYpCdLbeIEhX+oyYZAPYCFDc7O atxc9+sgtxQVpgb2XxHUGM8IahW4mRxfpS9WTObjqTtZYa5+Bm7Un3evbVm/Hg9AEsw5 rKbIZmr/trkvwzT9bdxlDhphPT2q7Jv2SVHamZHznjxtbv3LCxp15DybW8Fmd/uCOC58 RQdLFJpEHyKjf755TEWVCDApqZ1bjGwmrQKgIEu+2OzJMxH7D/QKW8fg0jNZV4HI+LjI zWsHRI5fkuBndPoPjd34VHdGAl9Xzk8u392nFLResLBcDCu+hOwdCsnw1d73f4GDcTc9 W/hw== X-Gm-Message-State: ACgBeo3JASsbsMNLc0Q/nefTWSp7KAf1ZpTdmq6xZo/+67i3ElfWa8vr Kn/jH6te/O53yxWYmRZZ0lkLsK8Rq+gmHT+JkGIt+3IeHQOx1ZfTTk1Hp48qvyvCeEOXOecNsmt DK7647gmszqzE9LmEzr3a/VEGKQ0IRYLZD+WvnICl X-Received: by 2002:a37:74f:0:b0:6b9:c9ce:b86f with SMTP id 76-20020a37074f000000b006b9c9ceb86fmr575997qkh.193.1660196157674; Wed, 10 Aug 2022 22:35:57 -0700 (PDT) X-Received: by 2002:a37:74f:0:b0:6b9:c9ce:b86f with SMTP id 76-20020a37074f000000b006b9c9ceb86fmr575975qkh.193.1660196157457; Wed, 10 Aug 2022 22:35:57 -0700 (PDT) MIME-Version: 1.0 References: <20220810171512.2343333-1-eperezma@redhat.com> <20220810151907-mutt-send-email-mst@kernel.org> In-Reply-To: <20220810151907-mutt-send-email-mst@kernel.org> From: Eugenio Perez Martin Date: Thu, 11 Aug 2022 07:35:21 +0200 Message-ID: Subject: Re: [PATCH v7 0/4] Implement vdpasim suspend operation To: "Michael S. Tsirkin" Cc: kvm list , linux-kernel , Jason Wang , virtualization , netdev , Dinan Gunawardena , Martin Porter , Wu Zongyong , "Uminski, Piotr" , "Dawar, Gautam" , ecree.xilinx@gmail.com, Martin Petrus Hubertus Habets , Stefano Garzarella , Pablo Cascon Katchadourian , habetsm.xilinx@gmail.com, Laurent Vivier , Zhu Lingshan , "Kamde, Tanuj" , Longpeng , Cindy Lu , Harpreet Singh Anand , Parav Pandit , Si-Wei Liu , Eli Cohen , Xie Yongji , Zhang Min , Dan Carpenter , Christophe JAILLET Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=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 On Wed, Aug 10, 2022 at 9:20 PM Michael S. Tsirkin wrote: > > On Wed, Aug 10, 2022 at 07:15:08PM +0200, Eugenio P=C3=A9rez wrote: > > Implement suspend operation for vdpa_sim devices, so vhost-vdpa will of= fer > > that backend feature and userspace can effectively suspend the device. > > > > This is a must before getting virtqueue indexes (base) for live migrati= on, > > 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 vir= tqueue > > descriptors. The device can answer to read or writes of config fields a= s if it > > were not suspended. In particular, writing to "queue_enable" with a val= ue 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 [1] branch after removing the old commits. > > Except, I can't really do this without invaliding all testing. > Can't you post an incremental patch? > Oops, sorry. I can send it for doc and internal code. But is it ok to remove an ioctl arg with incremental patches? Thanks! > > Comments are welcome. > > > > 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=C3=A9rez (4): > > vdpa: Add suspend operation > > vhost-vdpa: introduce SUSPEND backend feature bit > > vhost-vdpa: uAPI to suspend the device > > vdpa_sim: Implement suspend vdpa op > > > > drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 +++++++++++ > > drivers/vdpa/vdpa_sim/vdpa_sim.h | 1 + > > drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 3 +++ > > drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 3 +++ > > drivers/vhost/vdpa.c | 35 +++++++++++++++++++++++++++- > > include/linux/vdpa.h | 4 ++++ > > include/uapi/linux/vhost.h | 9 +++++++ > > include/uapi/linux/vhost_types.h | 2 ++ > > 8 files changed, 70 insertions(+), 1 deletion(-) > > > > -- > > 2.31.1 > > >