Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4311237ioo; Tue, 31 May 2022 01:17:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnSYmgFg0X/+5a6QnOoUxnYOvvb1+KFI58ys8c1dU44oFbGotfj48IOVYXmS4Sz2xg8UKM X-Received: by 2002:a17:902:a710:b0:163:cdfb:4dab with SMTP id w16-20020a170902a71000b00163cdfb4dabmr10974372plq.110.1653985067875; Tue, 31 May 2022 01:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653985067; cv=none; d=google.com; s=arc-20160816; b=b9Y3GGGN5rKNSNrmoQxBkDQewnCmbuC1NHKx4K+sSsa4CAZqpXQw6Mex0dJ+2B2u8y Tl5uraVOjr3pbo49gRMOd5EIdKmOEeW2Bxh/wYn4NTTkhI3LkV7ojfMGCdEmKEMRLt1u rDRV86XpPyVKqLvu+Da9u+iOjTbRv7vZ7lk9cS/Ie93LC5mF7Eog4ieblYKMQ9/mfiq3 3IZ/KWKHGJywts+zXLWswcZLlJ6o7oIvzGo4NP8ure3nHDzlYVvmd27DTfAx6JSa55Yq qGn6YU97Z8efJyUCp6pbYDQDcmlxiXokpQNlAeQmenTlHrcUsIWRxtm9MRqD0sRS0R26 QUUA== 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=R09ZW9VvFl8cGzXr9uGNwD7esbAV/wMjvzPFPmxSk1k=; b=yPSWGrF9uy4oVQVD/gdot1FJTYNkDh6RzjMzrCsMwg5x4Psi+p74btL0NkkKAK7IJ4 2o01jOBii3vCj304sKSpBxPzfUZ3a4O9IBQG1SPjmtVFGa1g4ugyo+CkbgeTp+DC6AxA 70wu5Q15EXrJEJ7voqXgAG1k40wxubIt5jb6FcqNqY6XEOA4xlP/LspWmKMgQTSXcaiQ HSIt7sGj6i8kZEZQxj5gEWDtGOlKHKdcQ2504/a1cp+qqvvVvf3q3T+Yvxx6vtjkhnBP n70jJLDwCuTGhwYRZneSQ6znF8j20MrKgkHppIH4y5f061V7aw5aDRfY9ee1P8dnpE2I 7vxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aTRwrWhl; 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 p1-20020a63c141000000b003fbe543bd44si10450065pgi.170.2022.05.31.01.17.32; Tue, 31 May 2022 01:17:47 -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=aTRwrWhl; 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 S244345AbiEaGop (ORCPT + 99 others); Tue, 31 May 2022 02:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244340AbiEaGon (ORCPT ); Tue, 31 May 2022 02:44:43 -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 A31996D1B9 for ; Mon, 30 May 2022 23:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653979480; 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=R09ZW9VvFl8cGzXr9uGNwD7esbAV/wMjvzPFPmxSk1k=; b=aTRwrWhlf9d0cxbazaIxKp8s16DGJZb641Ipe+RjYrmq5FmRNHFSPri69ldzBprc+z5m5b 9iMwAN+p10yXRoMglZJHPUNwEHMRf5hgTEw+7mzEC94GKZ7epGJ7z1LqbkRkic2i18jUF6 DzrYKlGh+1Gyw/bW8YAUa3aUU2ZIAIM= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-GaCzW7L8OyqXSzLsKDYiUA-1; Tue, 31 May 2022 02:44:38 -0400 X-MC-Unique: GaCzW7L8OyqXSzLsKDYiUA-1 Received: by mail-lj1-f200.google.com with SMTP id s15-20020a2e9c0f000000b002554eee26ebso547464lji.21 for ; Mon, 30 May 2022 23:44:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=R09ZW9VvFl8cGzXr9uGNwD7esbAV/wMjvzPFPmxSk1k=; b=fEgSeX6advWgLPf+NzGjp+0U7ux3V7QNtmhaQSZPROS46OFLWGIQ8M3H+vuJ4plLFk wyCRnm3XewIIoT8vp85kmgmbaZVNAA1+HGweYdr4Xd6joTPg3O+Q67TunZ+lmEPJDxzz dkB5OIvX3aCGGF1IhgygMjSsocDqSC2Y6wcGsr7Z+eDqXJK3T2hrJCWD1q1/QpMZVQe8 MOpKaVqdo/7iABcmHucSWO1GhVIpjG3xZRfQNNcR3a2fZHSX206VOFZS3jjGGeGlVHVM IYQ40ar8hvlScNxwK4wvx56GM3M4v0vrE3uU5BV/uYZECyRT9efMpWcmvKOeDInO4Cy9 Qw7g== X-Gm-Message-State: AOAM532gI+00yd2bguHxnQWa+t9PImNGo4Y86/kZbtPa9k4V4iLR+pcq xQOVGuhBDBuJAA/MJrU0kmyg8ZpP3ypwti7nitfIUHea81aEpTe9pK94kM7zE+rp5/klyNlh5v1 YA0PP06m7U6+6+I+RMSsrNfdKlBBsz5+AW4OXfVcy X-Received: by 2002:a05:6512:128e:b0:478:681c:18d8 with SMTP id u14-20020a056512128e00b00478681c18d8mr32302244lfs.190.1653979477072; Mon, 30 May 2022 23:44:37 -0700 (PDT) X-Received: by 2002:a05:6512:128e:b0:478:681c:18d8 with SMTP id u14-20020a056512128e00b00478681c18d8mr32302209lfs.190.1653979476807; Mon, 30 May 2022 23:44:36 -0700 (PDT) MIME-Version: 1.0 References: <20220526124338.36247-1-eperezma@redhat.com> <20220527065442-mutt-send-email-mst@kernel.org> <20220531013913-mutt-send-email-mst@kernel.org> In-Reply-To: <20220531013913-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Tue, 31 May 2022 14:44:25 +0800 Message-ID: Subject: Re: [PATCH v4 0/4] Implement vdpasim stop operation To: "Michael S. Tsirkin" Cc: Parav Pandit , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "martinh@xilinx.com" , Stefano Garzarella , "martinpo@xilinx.com" , "lvivier@redhat.com" , "pabloc@xilinx.com" , Eli Cohen , Dan Carpenter , Xie Yongji , Christophe JAILLET , Zhang Min , Wu Zongyong , "lulu@redhat.com" , Zhu Lingshan , "Piotr.Uminski@intel.com" , Si-Wei Liu , "ecree.xilinx@gmail.com" , "gautam.dawar@amd.com" , "habetsm.xilinx@gmail.com" , "tanuj.kamde@amd.com" , "hanand@xilinx.com" , "dinang@xilinx.com" , Longpeng 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=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 Tue, May 31, 2022 at 1:40 PM Michael S. Tsirkin wrote: > > On Mon, May 30, 2022 at 11:39:21AM +0800, Jason Wang wrote: > > On Fri, May 27, 2022 at 6:56 PM Michael S. Tsirkin wro= te: > > > > > > On Thu, May 26, 2022 at 12:54:32PM +0000, Parav Pandit wrote: > > > > > > > > > > > > > From: Eugenio P=C3=A9rez > > > > > Sent: Thursday, May 26, 2022 8:44 AM > > > > > > > > > Implement stop operation for vdpa_sim devices, so vhost-vdpa will= offer > > > > > > > > > > that backend feature and userspace can effectively stop the devic= e. > > > > > > > > > > > > > > > > > > > > This is a must before get virtqueue indexes (base) for live migra= tion, > > > > > > > > > > since the device could modify them after userland gets them. Ther= e 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 the return of ioctl with stop !=3D 0, the device MUST finis= h any > > > > > > > > > > pending operations like in flight requests. It must also preserve= all > > > > > > > > > > the necessary state (the virtqueue vring base plus the possible d= evice > > > > > > > > > > specific states) that is required for restoring in the future. Th= e > > > > > > > > > > device must not change its configuration after that point. > > > > > > > > > > > > > > > > > > > > After the return of ioctl with stop =3D=3D 0, the device can cont= inue > > > > > > > > > > processing buffers as long as typical conditions are met (vq is e= nabled, > > > > > > > > > > DRIVER_OK status bit is enabled, etc). > > > > > > > > Just to be clear, we are adding vdpa level new ioctl() that doesn= =E2=80=99t map to any mechanism in the virtio spec. > > > > > > > > Why can't we use this ioctl() to indicate driver to start/stop the = device instead of driving it through the driver_ok? > > > > This is in the context of other discussion we had in the LM series. > > > > > > If there's something in the spec that does this then let's use that. > > > > Actually, we try to propose a independent feature here: > > > > https://lists.oasis-open.org/archives/virtio-dev/202111/msg00020.html > > > > Does it make sense to you? > > > > Thanks > > But I thought the LM patches are trying to replace all that? I'm not sure, and actually I think they are orthogonal. We need a new state and the command to set the state could be transport specific or a virtqueue. As far as I know, most of the vendors have implemented this semantic. Thanks > > > > > Unfortunately the LM series seems to be stuck on moving > > > bits around with the admin virtqueue ... > > > > > > -- > > > MST > > > >