From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E923AC433EF for ; Fri, 27 May 2022 10:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351028AbiE0K4C (ORCPT ); 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-Google-Smtp-Source: ABdhPJzyjSEByHUT1dN2e6dwR/wwQsgGO85W9JgRso9Wz+PFfyejclX0Yhn5dm9pxNJ4ZMKkOZKFiA== 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: 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