Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp386388imw; Fri, 8 Jul 2022 04:57:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uLRqS1OmPzg53BEBbmgPDUXKyPnv9HpYzg3eMWOkovalENgOZxH+pS9cb0V4EjRTLNIDMF X-Received: by 2002:a17:907:1c94:b0:726:307c:8be7 with SMTP id nb20-20020a1709071c9400b00726307c8be7mr3258954ejc.443.1657281424988; Fri, 08 Jul 2022 04:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657281424; cv=none; d=google.com; s=arc-20160816; b=FeUjykohktIUwrRQpKXeISTV2VS56VOIQXz+CMhV6zBLO9pa9VcC7TSI5LHcIqDPP7 mnzO2DT/y4Zu79B66Ylk0z48BlYQ/1qRWgqm0KTZaefArdd23TmJa5AIQTFGXZ8FOVSo nO5NPjSvfC/+MmEvzjwc21avl3QteCdOYpkvVXdcLBBPNXAVRHJistZqIXjzCYTGs7Pq zLlYWyTqCJxkV/pS01a6+cg/YqewD08tnVgrI8mz/LyTKsNjEWVxzl+yGIgeep3THBmW 11KK+t8z3uX9pLM2V2sVgUcoKH1YfQA/9ezKwYW8/3ccXzHGdMpkaCrwuStx36x5qq1u nDlg== 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=UAhm09EfssnFXCcdbsvbfvfsk3WrYS8DdytneLUevKI=; b=B2UUJT+r+zedvYCoXzPDaV2Y1a8ANpTFCZC9rsEAVB4e8IqXwM6/Kwy5PpyLoy7v64 1chmb/3bDMApJe/4Jv7RMPhexRme7h1sOc71Zc6telS0mWEK5Z35VzZO/Jh0GGwnGKzZ YKbDafBoS1ahOxXlYEruRC7MM/8njI4N9BM0YWwPpzrAMlYV01UzMIReMXiQbns6zMCL D4Omhc4i70pWSdw7MBQm7p6itexgGK5Y/wNQm4LA4AlDdl03vfcXKNgGz5mBukZs8TNJ zMdDS6C+awS5oiYYKmfGau/4D8cfYzKEVOBwVG9Xu7iuf24c1Ybt83qoBDsZsRE6kvoP d3Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GT6aS34s; 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 bq16-20020a170906d0d000b00708423d4250si11401296ejb.228.2022.07.08.04.56.38; Fri, 08 Jul 2022 04:57:04 -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=GT6aS34s; 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 S238004AbiGHLbA (ORCPT + 99 others); Fri, 8 Jul 2022 07:31:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237996AbiGHLa6 (ORCPT ); Fri, 8 Jul 2022 07:30:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 039D2BCA8 for ; Fri, 8 Jul 2022 04:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657279857; 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=UAhm09EfssnFXCcdbsvbfvfsk3WrYS8DdytneLUevKI=; b=GT6aS34skfT8F5lPPnSnLGtlOYLicOddG/IZJTADFwrG+qUHbLMDQmw4AI9cn6B/HGJcEf yv9IZYeHPYLDsLYD80wnAhE+BgoQRVV5ZmlZIubIdjyayBx7qwF3Rel0i7yt6QTGOaV1WK ZfNsZvo6fLtIJOIWjQyR4ibq4MA8blM= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-319-hlUPzePNM3ecP4e_O2Ntpw-1; Fri, 08 Jul 2022 07:30:56 -0400 X-MC-Unique: hlUPzePNM3ecP4e_O2Ntpw-1 Received: by mail-qk1-f197.google.com with SMTP id f10-20020a05620a408a00b006b267fdf71fso18653871qko.6 for ; Fri, 08 Jul 2022 04:30:56 -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=UAhm09EfssnFXCcdbsvbfvfsk3WrYS8DdytneLUevKI=; b=2S23Ax9ZahLLcFkqXnrN8G5A2chpuaSwiOfx+F6X6/zUqK2ERRkwep+7ra2H98ICi8 DnVXyxgYrWEJuFFQ0hzB9mM7+Hhp+EReYX0HNm3D345aa/QgJPRzIFJ7hDFGh3ZCMq30 /VxVIzMXFXsBPg3bBIYjfLhFo0H9NqQ7nToO0vXRTTdQP+3lTMuof7q/e7qh1L3yoU2c N7FoeCS2yA9zCb9G49PQLK05Zx8PsB8Qnc/giEARouPCtW4ZQT7vB2pv1S7A9dSJ9vE7 hGOlJ6Vy8vs0GRxZDNDJKFXaoy3VxWtx76tnQ9AnthBdFln/H2Smqfq6z+tLkc8x18It UlXQ== X-Gm-Message-State: AJIora9U2fO2ijB+Aw3YmWlR8gq11/ij37ggvzZICjAwNxGwGAd48eii GiDI7on6dMknAwMFx5UV1Ck/Ia42otmd2/YT0epdLFo3uflKo771y0Kjjxl7HokmIAqEshYnXMH nuo1Xhwx/nvOvNr+ANEoyFj+P+EOagWBI9okclYHu X-Received: by 2002:a05:620a:1a28:b0:6b1:4d4d:c7c3 with SMTP id bk40-20020a05620a1a2800b006b14d4dc7c3mr1814596qkb.522.1657279855631; Fri, 08 Jul 2022 04:30:55 -0700 (PDT) X-Received: by 2002:a05:620a:1a28:b0:6b1:4d4d:c7c3 with SMTP id bk40-20020a05620a1a2800b006b14d4dc7c3mr1814565qkb.522.1657279855371; Fri, 08 Jul 2022 04:30:55 -0700 (PDT) MIME-Version: 1.0 References: <20220623160738.632852-1-eperezma@redhat.com> <20220623160738.632852-2-eperezma@redhat.com> In-Reply-To: From: Eugenio Perez Martin Date: Fri, 8 Jul 2022 13:30:19 +0200 Message-ID: Subject: Re: [PATCH v6 1/4] vdpa: Add suspend operation To: Jason Wang Cc: netdev , linux-kernel , virtualization , kvm , "Michael S. Tsirkin" , Parav Pandit , Christophe JAILLET , Cindy Lu , "Kamde, Tanuj" , Si-Wei Liu , "Uminski, Piotr" , habetsm.xilinx@gmail.com, "Dawar, Gautam" , Pablo Cascon Katchadourian , Zhu Lingshan , Laurent Vivier , Longpeng , Dinan Gunawardena , Martin Petrus Hubertus Habets , Martin Porter , Eli Cohen , ecree.xilinx@gmail.com, Wu Zongyong , Stefano Garzarella , Dan Carpenter , Harpreet Singh Anand , Xie Yongji , Zhang Min Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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, Jun 29, 2022 at 6:10 AM Jason Wang wrote: > > On Fri, Jun 24, 2022 at 12:07 AM Eugenio P=C3=A9rez = wrote: > > > > This operation is optional: It it's not implemented, backend feature bi= t > > will not be exposed. > > A question, do we allow suspending a device without DRIVER_OK? > That should be invalid. In particular, vdpa_sim will resume in that case, but I guess it would depend on the device. Do you think it should be controlled in the vdpa frontend code? Thanks! > Thanks > > > > > Signed-off-by: Eugenio P=C3=A9rez > > --- > > include/linux/vdpa.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h > > index 7b4a13d3bd91..d282f464d2f1 100644 > > --- a/include/linux/vdpa.h > > +++ b/include/linux/vdpa.h > > @@ -218,6 +218,9 @@ struct vdpa_map_file { > > * @reset: Reset device > > * @vdev: vdpa device > > * Returns integer: success (0) or error (= < 0) > > + * @suspend: Suspend or resume the device (optional) > > + * @vdev: vdpa device > > + * Returns integer: success (0) or error (= < 0) > > * @get_config_size: Get the size of the configuration space= includes > > * fields that are conditional on feature = bits. > > * @vdev: vdpa device > > @@ -319,6 +322,7 @@ struct vdpa_config_ops { > > u8 (*get_status)(struct vdpa_device *vdev); > > void (*set_status)(struct vdpa_device *vdev, u8 status); > > int (*reset)(struct vdpa_device *vdev); > > + int (*suspend)(struct vdpa_device *vdev); > > size_t (*get_config_size)(struct vdpa_device *vdev); > > void (*get_config)(struct vdpa_device *vdev, unsigned int offse= t, > > void *buf, unsigned int len); > > -- > > 2.31.1 > > >