From patchwork Wed Oct 26 15:08:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Boeuf, Sebastien" X-Patchwork-Id: 11300 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp328652wru; Wed, 26 Oct 2022 08:18:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YAc+64V4Jt2iPM8YiRkjXQ+c55OF7U2u4S/UwHvzX/OOh44U/pEHu4HfoctA+iOg31e9Q X-Received: by 2002:a17:907:2bcf:b0:79d:e8e6:d579 with SMTP id gv15-20020a1709072bcf00b0079de8e6d579mr22784607ejc.563.1666797528520; Wed, 26 Oct 2022 08:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666797528; cv=none; d=google.com; s=arc-20160816; b=s/Xfqpcf0l/Ti0HSYWitHx6YsEfvTiB+JfmhLOlQckXzDwTrWWYZ8uM8idb8bTjBUY sCNwTNLJCkfekFHvSEFyN7Dj+XGCfqEuBD+VwzYWPjRBIjVKgwDMr7gTjRbIuzCJhIBE /FyQbBq0LVAx6qwPlvQr84xmXq6M0TkdxYFHW0zSFTU2mMz81xX3vIwMlPqN/7XQuu0W cRSh7sj6YfEahf2/h58Zey/5bPPS1ULRhATvPOEHm5W8vTX7Ouo/ymgr17s2vX0HUDeS EtwrIbDdGmewcJh0kAoGGZMpuO2YnIO5pdpvvCDByq1kM2iIhIH7LvBAfOBbo0OcIXLR pndA== 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=Y0B8zBWf9zKZ0xRcGpLnswJSw5iCIWFUeIHwAsiGyUluUhoV07PeV64PoApBpRXK3s coOvVbGJwkiWudpPTgmzGLk9JcNw10L2bfNeBRDfX8aThWHYr+WIxBIsCbo4Sz2RI36h Gm/MSiWzgITzoFURFD/aiyEBDlTt/2FW3zFGSS2tP4jsrzojcYk9w7kf2Hrur2WxV4xG BiSVSvYMewii8Een0VKX57WGOXIqUO0SRcS2bo+9giGbufzeHGuA7QGa0FXXx3IB1FiX 26khf8y4SB3TDA9tNtNDR6xBV9j21gzuP0um//WwVjP8htrAV0wH03whGCcUN2x2lQ1+ 9P5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=C6s9+Nji; 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 l21-20020a170906795500b0073db353cb25si6497246ejo.869.2022.10.26.08.18.22; Wed, 26 Oct 2022 08:18:48 -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=C6s9+Nji; 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 S234470AbiJZPI7 (ORCPT + 99 others); Wed, 26 Oct 2022 11:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234280AbiJZPIw (ORCPT ); Wed, 26 Oct 2022 11:08:52 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5931912347E for ; Wed, 26 Oct 2022 08:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666796932; x=1698332932; 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=C6s9+Njiw4Iseaahok1QTFaCimIdHyeutV3JInD/G+kpqG1OxX77hQ46 E1TBU2+XkEjjf6R9mpfPuS1StS7E/w21yMf5Bym5y+Dz3vFIp7H4BOS+N yexsGMeaIyE08HyxRyPcBiV+7kq1NfiK4iOqCFVuxqqNH7qwCS5+sgDqr n6NAgioDy9asP6c7qZLYrz4NbKsoaOsHOC7QcOnuVMlhZRUMN6gOw8gq9 b6i59F4YSwqEN9zHvuiuBaJjUoQLP/axWs4Gj+lwLUNXfftty7zHPzQIl EcJ7Wl5ln9o0ql3RPbgy3BArRKp+XweDIWll7CDNoxSLPW0+hwIj8GKVD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="370035946" X-IronPort-AV: E=Sophos;i="5.95,215,1661842800"; d="scan'208";a="370035946" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2022 08:08:51 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10512"; a="961252435" X-IronPort-AV: E=Sophos;i="5.95,215,1661842800"; d="scan'208";a="961252435" Received: from briansim-mobl.ger.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.29.107]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2022 08:08:49 -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 v5 1/4] vdpa: Add resume operation Date: Wed, 26 Oct 2022 17:08:35 +0200 Message-Id: <2c10a3b3a52081fc467868e6f2c2b4bdc12584f1.1666796792.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.9 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,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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?1747763885046716674?= X-GMAIL-MSGID: =?utf-8?q?1747763885046716674?= 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);