From patchwork Tue Oct 18 08:37:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Boeuf, Sebastien" X-Patchwork-Id: 4026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1849221wrs; Tue, 18 Oct 2022 02:02:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56TWQTg0WQtrxWxWJ70IDXRG8GmsXhmKuv++f5pBZ1QUm3ONijWgEqgVJc9LLq6RC+uhEt X-Received: by 2002:a17:907:a47:b0:780:6883:2a37 with SMTP id be7-20020a1709070a4700b0078068832a37mr1521962ejc.219.1666083778999; Tue, 18 Oct 2022 02:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666083778; cv=none; d=google.com; s=arc-20160816; b=hVbWKyFeOF/qd25NMhtnHu8zmJyAByiBiXJ/AONw056xfhlq8kOATHHt/9XLN71wKF r/UoU5sH1KsHt1UdexFF1PoDXO/4AFjMY+1nTpciXnWfINH8pqs8iyQuWvazCvw2AmIK 15hnAn2567HK7OORIRB11zvwip7yjwmox1rZMgvf92Gl9jVZkq8wypgSAZUJMvZlL9pp ZMng6lUkOgSPZYW6maugF8aEbVE4zP0z8+vj7od/ed2OD9MxgX0I3D2UHF53I1b2qEBe iVS4ZKJdo9fJo0gf10lgs8OUkqYKD4r3BiemMjgx+EUEDwhoorlmiddbIxxpYaCvIHmw pKDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CmutJhSnCo7GzUEgjGUiWPoZ4PIgkK24LIqJ3waWfKs=; b=r4yTIrAUbk3TrESfYFDHQCskI3l0fGdGWv7TTEw96DvEyKnpbO5OrtnOuZFf6yyFwN gHVip/7kjHI3ZHEpKDC5UUucKoX5TBu8LoWmEr1Bs7xAKkYzgBev9x9I5FDMKm86n9Va xekTOYFkl2+084SgKtc5Pf9YkjwxvbLU1McDCv/0zHlDEC3pisdTSWgyfJF8TqxwiCSX y9NrpTlvWZPq+WhbN69GVMC0GVlaKuQoUTKhQS0cBeoR+weBGSmGAtlqDCTqHpbUhgBA Do2Ctc5HUXQm9EHl6baFnpPGBtzp4I3BRsEa7cxMSz0Dx4nODauZM8clgrFaN5RJgfP2 iofA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=l96uS4Em; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r14-20020a056402018e00b0045c7c7b95easi10031257edv.73.2022.10.18.02.02.34; Tue, 18 Oct 2022 02:02:58 -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=@intel.com header.s=Intel header.b=l96uS4Em; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbiJRIiY (ORCPT + 99 others); Tue, 18 Oct 2022 04:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbiJRIiQ (ORCPT ); Tue, 18 Oct 2022 04:38:16 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25C19F740 for ; Tue, 18 Oct 2022 01:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666082294; x=1697618294; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w/VJ/zZxV+j4zvTylkKvQJvW+/QH7d4xZGt7+Trkcoo=; b=l96uS4EmYUO3BLTGwChexAWk0zVXAtKM5sy2kKK3J1ondbDbPmPqQmB5 I6PqKoafoNslnU+PjJzpJnrsLr4ZGVz1J6i6KlpcotYH+AczQlgYlPhTp aOoKVBw+fOC98r/CbXZS/RSOhrBHgG0Lp0RjHIiBDiwEgXhQXm/kE0vph vGDH0B1juUIRBYG9EkUctUxBrtcSPhZXdcb1mzpoxmkAEgPFPS6AZIEPd /ePZo56ybq4+cDNwFtlPLsh1cccf/VcOf2q+VkrcHqF20NLkOb3gFa+1Q qcwpm3OnU2vQ+Mek0PLfBifh7lyFYO3DigCgrm0kedOURf+Tl7fGDSsc9 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="307125502" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="307125502" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 01:37:56 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="753951033" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="753951033" Received: from aboyhan-mobl1.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.26.192]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 01:37:55 -0700 From: sebastien.boeuf@intel.com To: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com, sebastien.boeuf@intel.com Subject: [PATCH v4 1/4] vdpa: Add resume operation Date: Tue, 18 Oct 2022 10:37:24 +0200 Message-Id: <17c8f9fba6c8533cce013f7613247a527d4eed42.1666082013.git.sebastien.boeuf@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LOTS_OF_MONEY, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747015440924137052?= X-GMAIL-MSGID: =?utf-8?q?1747015464671830550?= From: Sebastien Boeuf Add a new operation to allow a vDPA device to be resumed after it has been suspended. Trying to resume a device that wasn't suspended will result in a no-op. This operation is optional. If it's not implemented, the associated backend feature bit will not be exposed. And if the feature bit is not exposed, invoking this operation will return an error. Acked-by: Jason Wang Signed-off-by: Sebastien Boeuf --- include/linux/vdpa.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 6d0f5e4e82c2..96d308cbf97b 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -219,7 +219,10 @@ struct vdpa_map_file { * @reset: Reset device * @vdev: vdpa device * Returns integer: success (0) or error (< 0) - * @suspend: Suspend or resume the device (optional) + * @suspend: Suspend the device (optional) + * @vdev: vdpa device + * Returns integer: success (0) or error (< 0) + * @resume: 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 @@ -324,6 +327,7 @@ struct vdpa_config_ops { void (*set_status)(struct vdpa_device *vdev, u8 status); int (*reset)(struct vdpa_device *vdev); int (*suspend)(struct vdpa_device *vdev); + int (*resume)(struct vdpa_device *vdev); size_t (*get_config_size)(struct vdpa_device *vdev); void (*get_config)(struct vdpa_device *vdev, unsigned int offset, void *buf, unsigned int len);