Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2405726ioo; Sat, 28 May 2022 12:36:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx824qSoATzEY+IYQ6og5WbxQyt7W4DcyVxYi87TjdoAgRdN1S3kjRUlJYiKBj3W8J+RsLE X-Received: by 2002:a63:f003:0:b0:3db:84d3:743d with SMTP id k3-20020a63f003000000b003db84d3743dmr42448782pgh.97.1653766565302; Sat, 28 May 2022 12:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653766565; cv=none; d=google.com; s=arc-20160816; b=aaZZhot59di2Iv+wV+Ns9o4JA9vgJLM7iQv+J6LL7ifWjfFuulZ5a5ApBZxPFqXwo/ qGhrpI9vGCbyOlaxrCczot7fQNpru43UbNgCqV5KCg2ve9VtuVW2O/lqfrHFHr3qE87G n0M5SPbX+CBPDNkJSlGGNq92E+drfEc4pPKM4T9S/BWmNGk2cbDLdczADEwSKcpHH49E 3TsiDOrYS5R9E5gJL7J6OWICObcphqazfdYVxtWeolkWi2LT1I6HIXq/Ox57UMk7Jpyq rHj5cx3mvnS0GyihrQg0xLft0HR4VEr+faLYGuKZpHyvDmLdB1Juxh2LfenFurdL/bri pO9Q== 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=gGQcppmnDaS/J3TRXiziyA5gL0rtQs0/Sd1uzUmYxEU=; b=uE+z16/BMsroyo4lq87Nj+93D67pkmcO5j8XTkNZ1OwyCu74OqTdY4dCqlWO0nLKSv R6wE35MmQjvNKGqHPwKnbN4fOp9M1C59vX/FT8yB5fnVnsrEOUFkm6bOmDmL04cQcEuW P1mcnuNP9QhwskJs3U309iHfOxD9JhKU8Me3jHw6ZHm0Qy8Mqvbl2+IbmXnE/7a9mbVH NJP4WtColU02hz5HK+eyUri65vMauiwVSBFGfLDYJ7oghLKicrXWVo53WztVATfP01Fh T/PBYVjE0YTyPI6gATiFV4TCS8nEjVT9ARV4AppQFJwiax4HdrWcTdVZTO0lWnzkRfj2 95kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TX/g3FXr"; 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 ng9-20020a17090b1a8900b001dc443e79a2si8350881pjb.8.2022.05.28.12.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:36:05 -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="TX/g3FXr"; 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 A18752D1FA; Sat, 28 May 2022 12:01:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350013AbiE0K4C (ORCPT + 99 others); Fri, 27 May 2022 06:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348666AbiE0Kz6 (ORCPT ); Fri, 27 May 2022 06:55:58 -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 96D4912E309 for ; Fri, 27 May 2022 03:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653648956; 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=gGQcppmnDaS/J3TRXiziyA5gL0rtQs0/Sd1uzUmYxEU=; b=TX/g3FXr8yz7Z4SKaqizhItgcvzPTwiWs0UnO8RLql2ZHXLrE2lKFmltLJ5ce6ogyCaDhz ouvtKFLXGk4YeaN6GwgYLwfU/yQCE1a5tCf2rYiwgU5NI2oGD3uAQplMj+KX0jiUH9ITDp 5O/lrqM8QeB445XnLCX8/8ysK6lxKYQ= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-488-R_MOWH4MMMqk-gAkFfdE7w-1; Fri, 27 May 2022 06:55:55 -0400 X-MC-Unique: R_MOWH4MMMqk-gAkFfdE7w-1 Received: by mail-ej1-f72.google.com with SMTP id i7-20020a170906850700b006fec53a78c3so2271475ejx.1 for ; Fri, 27 May 2022 03:55:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=gGQcppmnDaS/J3TRXiziyA5gL0rtQs0/Sd1uzUmYxEU=; b=lnAJgrMkTHUk9bQepcDNFVmncadDEaVQMkOj9sEQ/Kmyrav5Gda1EweRnBSQhYsgfV 1wEIdYHHiLJifIQ64/k3fvUgEa3R21DDQv34IOpZB1LYPOiwIz66hgoFpZoMBgAPei1Q k2SURvhgJcuMC8+DiynE9d9ZeKEBXyVILKEqCURGJYKu1P66fyM4o0k/VCYTXxdvRnQa 0GUMM5Gfy0kHav0gAsath5GKP+FDUByDZ/ch5qxcE9Zh7EiMeYwgAA802+5ceKAzXWwo YaR9O6DIpQCoOmXSgbZaFn7eiqLIebMC1OS3DizGvItyAcgUP+Wzf/EESyP3wXxJElX3 AdNg== X-Gm-Message-State: AOAM531X0M5Q5PngoqM+gmi/yJgUZ2JXlWgy3URlT2+OLyY5PLGcKnpC fijPtEsBLgWH1x13C6Jg5PLjpryfD3OdiO50LivY9t+gtBvgHZRH/HP5GHWbJQ6td5B10pqU4av inxLoAUQvdN3fi4MZjxGjeOio X-Received: by 2002:a17:907:8a03:b0:6fe:c10d:4bf8 with SMTP id sc3-20020a1709078a0300b006fec10d4bf8mr27371022ejc.308.1653648953915; Fri, 27 May 2022 03:55:53 -0700 (PDT) X-Received: by 2002:a17:907:8a03:b0:6fe:c10d:4bf8 with SMTP id sc3-20020a1709078a0300b006fec10d4bf8mr27371006ejc.308.1653648953659; Fri, 27 May 2022 03:55:53 -0700 (PDT) Received: from redhat.com ([2.55.130.213]) by smtp.gmail.com with ESMTPSA id fm6-20020a1709072ac600b006fec98edf3asm1318544ejc.166.2022.05.27.03.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 03:55:53 -0700 (PDT) Date: Fri, 27 May 2022 06:55:44 -0400 From: "Michael S. Tsirkin" To: Parav Pandit Cc: Eugenio =?iso-8859-1?Q?P=E9rez?= , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , Jason Wang , "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 Subject: Re: [PATCH v4 0/4] Implement vdpasim stop operation Message-ID: <20220527065442-mutt-send-email-mst@kernel.org> References: <20220526124338.36247-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 12:54:32PM +0000, Parav Pandit wrote: > > > > From: Eugenio Pérez > > 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 != 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 == 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’t 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. Unfortunately the LM series seems to be stuck on moving bits around with the admin virtqueue ... -- MST