Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2363918ioo; Sat, 28 May 2022 11:20:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRrNHUGIomVqjS0jv6BgWeVTqL2/H+j7gZjMAmtGuGqA+kCyXYWqpP6pY4Dm51gXON91dB X-Received: by 2002:a17:902:6907:b0:162:1237:42df with SMTP id j7-20020a170902690700b00162123742dfmr35246022plk.157.1653762055536; Sat, 28 May 2022 11:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653762055; cv=none; d=google.com; s=arc-20160816; b=ISY+owI8RPPu9RAzI9sQYvEIjG3RkVRtB8vyTRmazizL8Tujhc2h+c6ygSzdPnc9wR UpHy1L1fD3lOPhRtsdEpEGVdkmMVJUBWN0URIqnoGC1i7Beu0A47tXyDAWWav5Ugn354 C3oI/J6Vjm298FPV4ri3M68u6V92QtU49p3mkBYLHpAcA+0xJ+Pc5jxbmyL80+q0uAFq uH9eDHkmdmdtFDOc6RiPZ6uuWyRd3bUxOA6RrKCodGkyoptyMNAjv16urbgdqM0en+MG pxFZrCw5h0gVAtqPvq9U1GkMpoSkbP56Z5dXEsJzgyf39C4gs4cqx7m5bdZ23e3OJgEm 0SLA== 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=oaDAshEcGYeYhJ5+Zo99OPfgNFs1k3b7zVlzbxHYNl0=; b=WEZzb46T24p1Sy9hgFKJWm++kD/tqrXC4HdjO6VtWqmt3hVYh+M/QhPLyQYCIAXoPB ekHEbtU34CyRMaqIlih6G4+xDbF4jqu4JB6/uMHqY7cK13/0sViN8zJmewytKQrRuP6G q222ob8W2qjhNgs8orYz5Kf6A1LhV+/BzZUWq7boMepnwnf84tMJY55psMFdhJZ2ugEY jIs1WuczGPQ7fbZuLzJBxiQ/d4YWnbrpEYF1bdKQO0nkpxl8KIh/gZUgfLzdWtVQNMtO LYP2orlRv5nOFfNRm+Wj+VgVB8f+4v797g488Eo8MV44j0DgZCETmUUqSCMIDW4RoSVZ rYYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MsoZxVsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j188-20020a6255c5000000b00512e6ab7b80si9216618pfb.33.2022.05.28.11.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MsoZxVsd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 276F414D3A; Sat, 28 May 2022 11:20:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234994AbiE0C1A (ORCPT + 99 others); Thu, 26 May 2022 22:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234949AbiE0C04 (ORCPT ); Thu, 26 May 2022 22:26:56 -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 8A9B9DFF49 for ; Thu, 26 May 2022 19:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653618410; 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=oaDAshEcGYeYhJ5+Zo99OPfgNFs1k3b7zVlzbxHYNl0=; b=MsoZxVsdQq/zRH23U6ED0gdtz1Yg9cjvDnfEgPZDQ9N4Pxa5/ps8AN/SXeYjIzQ8J3gkWe P41sW5r71Ndz4fOchno3wy7tBk1UAVTCV75BTmjC3vn/FZRYi+5Yfb+qPfhvbKGVcig60P iUfbLulsOda9qOalJHCsQ+ZwzDfk68o= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-14-h2i7CJyvNu21s-9IT-eMwQ-1; Thu, 26 May 2022 22:26:49 -0400 X-MC-Unique: h2i7CJyvNu21s-9IT-eMwQ-1 Received: by mail-lf1-f69.google.com with SMTP id z14-20020a056512308e00b004786d7fde66so1338313lfd.18 for ; Thu, 26 May 2022 19:26:49 -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=oaDAshEcGYeYhJ5+Zo99OPfgNFs1k3b7zVlzbxHYNl0=; b=YotUrf66IIlhjUf+d/K501/D6Zvd9gKfg7bky0yvnNKPpTSfzMjqX4bRmggK5WLRvL n7N2w4/1MKc8DBTHPogwnF4XQqA6wYWKwRG7Muj2ptUwiYfsF8j61QEEwWDtl/iwnMF4 rrscKjcf1PwyEKBGTzRtKaI/wKuegNLMt3k2rjRZ4Pnb3NiDjfOaObEiV5nILctkP+Mc jJCxmU5BqbSpKJlyXgISq5WBoYOrIU4KLJXNtS3K09rPBKRaKmkqYwk9sNSGjkqjmBXB KeuXsNQ/4ZHdh4akEDGoL/cw/dSwngEhUPBVX05TozLgPRzjyF7w/Pq2yIYZGO1A2Zc9 EQIQ== X-Gm-Message-State: AOAM531zLrZOGjeUjX8vR0UHMZzIwM1ZcihXTuufAsnJUX9H3o03bwyU z44EFakMrRMr7oydNhRQtzp4yIZ/TBKRlXgU3OayKCgl+oLwvcgI/MlUWIs8hsoEVAELFvZcrMM QRnp1o5KZ8IXrxVSyzWikIZ75WFJVh3XaV0hrhPal X-Received: by 2002:a2e:954c:0:b0:253:d9bf:9f55 with SMTP id t12-20020a2e954c000000b00253d9bf9f55mr21308472ljh.300.1653618407874; Thu, 26 May 2022 19:26:47 -0700 (PDT) X-Received: by 2002:a2e:954c:0:b0:253:d9bf:9f55 with SMTP id t12-20020a2e954c000000b00253d9bf9f55mr21308435ljh.300.1653618407570; Thu, 26 May 2022 19:26:47 -0700 (PDT) MIME-Version: 1.0 References: <20220526124338.36247-1-eperezma@redhat.com> In-Reply-To: From: Jason Wang Date: Fri, 27 May 2022 10:26:35 +0800 Message-ID: Subject: Re: [PATCH v4 0/4] Implement vdpasim stop operation To: Parav Pandit Cc: =?UTF-8?Q?Eugenio_P=C3=A9rez?= , "Michael S. Tsirkin" , "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.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_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, May 26, 2022 at 8:54 PM 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 device. > > > > > > > > This is a must before get 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 the return of ioctl with stop !=3D 0, the device MUST finish any > > > > pending operations like in flight requests. It must also preserve all > > > > the necessary state (the virtqueue vring base plus the possible device > > > > specific states) that is required for restoring in the future. The > > > > device must not change its configuration after that point. > > > > > > > > After the return of ioctl with stop =3D=3D 0, the device can continue > > > > processing buffers as long as typical conditions are met (vq is enabled= , > > > > 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. We try to provide forward compatibility to VIRTIO_CONFIG_S_STOP. That means it is expected to implement at least a subset of VIRTIO_CONFIG_S_STOP. > > Why can't we use this ioctl() to indicate driver to start/stop the device= instead of driving it through the driver_ok? So the idea is to add capability that does not exist in the spec. Then came the stop/resume which can't be done via DRIVER_OK. I think we should only allow the stop/resume to succeed after DRIVER_OK is set. > This is in the context of other discussion we had in the LM series. Do you see any issue that blocks the live migration? Thanks