From patchwork Tue Oct 18 08:37:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Boeuf, Sebastien" X-Patchwork-Id: 266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1849046wrs; Tue, 18 Oct 2022 02:02:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Q10WK77S+Yb5I/m0SpOMx/wkc8Z5apFECIBGJT4uPrVPafE5A+qxKwA2HWxWeR1S3yFYa X-Received: by 2002:a17:906:9746:b0:78e:11cc:3bb3 with SMTP id o6-20020a170906974600b0078e11cc3bb3mr1536407ejy.379.1666083756221; Tue, 18 Oct 2022 02:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666083756; cv=none; d=google.com; s=arc-20160816; b=gJEBUZ/mdU7bq39L27dFxdzCvPP/euU97zIesQLc94wR3UDAAagW3tWxhqHSst/8TD RJEOJmGLpHU6G0CTU+PsJXsvMVjf1PeL5gJB1J5NHvXMCUATw+aEp64P2PZpNGB0stCJ JyGzFfRGLEuN1gw/6/yvW5iNS/u5ZQTeSym1wniAUsdR3uslOjd3AdeQg73GPFgVdCh8 yRRq5buXZ8lODJoX6+cUbteW1KDI1lIdINRUtcwPFYKhXsw1VsrMcrSH8rcl5ektfIH4 PVv5cM3VTqw/LOR2cVpDhvWHzVPYnuHGySN0Cgfmtr94cJl0g7xPBamtmPcdm4EqWqzX z1+w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=fhYTppKqBPHqS7vufkyQ8OZVYz20UdIKLoC0ozrFTNw=; b=ou1JUlqAv3aAwK8npEDZqPb1gPRQw/xvOtGc4yZlv0fongoJEDgBnqac/VNyr1m7Yx Jbxd/4dqvEeaJ0urnY6WH7DIcx7PcVLRUy30qGLCCHuW/xXuCBSFmTYBhBaZEpSrvd3G +SMQ+kjr9a3ZJGz5wxPzvylM7bMgxLm+NeUq6lKwkmWvO5/S+SWHfQvNTaMf0o23pHeA VcVhndktXd9svOSdVCE5dRG1ZYMBsQEkG/xy/FCfiiw7iAQqG6hDRcKHBKLBDT6d6gfz HjzrWKZL+bFXGrTQUQvV4ojafUBBFPX/jQlE3Mt3so+65ln4Y96khgrI9xx3prDFsql+ OzZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AsJQLWIq; 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 e14-20020a50a68e000000b0045cba2d74c3si10451130edc.541.2022.10.18.02.02.12; Tue, 18 Oct 2022 02:02:36 -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=AsJQLWIq; 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 S230106AbiJRIho (ORCPT + 99 others); Tue, 18 Oct 2022 04:37:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbiJRIhl (ORCPT ); Tue, 18 Oct 2022 04:37:41 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856F061B0D for ; Tue, 18 Oct 2022 01:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666082260; x=1697618260; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nvFiXqf6TNu5W6qNejIJGhy4YQBn15VbmGk6jolXYYE=; b=AsJQLWIqOWlO54hScj/qoKesGlqiwLCTBBjkBwytrv5/Re6nG+kKRLQo gptgpgHp3XbPKBd1VuH3PebboSFAOErKkeBT0YIgIx+XoCB67oxV3jddt uh7mMaD6e6AbaIpNKab1mIPa7p0BQxOhDCqqqlxkbI+Jwwb1NqZH53Qv4 JScOYPiJPFAn2NX5hCy3MXxmBSJjUfGzv1dCqOj5HuuTQbP+e7QNHJSN9 7YwDf9UNvvFgWQ7GbethJdKfmb9s2Rq+vFFgFgoiBfknkv9l9rqIIzMD3 1WfpWldTkjzh5F8U0dyD1lzREdzK4uvQAHvaYNGiMFkPxcdnsXeNcMOFV w==; X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="307125410" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="307125410" 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:39 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10503"; a="753950970" X-IronPort-AV: E=Sophos;i="5.95,193,1661842800"; d="scan'208";a="753950970" 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:37 -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 0/4] vdpa: Add resume operation Date: Tue, 18 Oct 2022 10:37:23 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 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?1747015440924137052?= From: Sebastien Boeuf This series introduces a new operation for vdpa devices. It allows them to be resumed after they have been suspended. A new feature bit is introduced for devices to advertise their ability to be resumed after they have been suspended. This feature bit is different from the one advertising the ability to be suspended, meaning a device that can be suspended might not have the ability to be resumed. Even if it is already possible to restore a device that has been suspended, which is very convenient for live migrating virtual machines, there is a major drawback as the device must be fully reset. There is no way to resume a device that has been suspended without having to configure the device again and without having to recreate the IOMMU mappings. This new operation aims at filling this gap by allowing the device to resume processing the virtqueue descriptors without having to reset it. This is particularly useful for performing virtual machine offline migration, also called snapshot/restore, as it allows a virtual machine to resume to a running state after it was paused and a snapshot of the entire system was taken. Sebastien Boeuf (4): vdpa: Add resume operation vhost-vdpa: Introduce RESUME backend feature bit vhost-vdpa: uAPI to resume the device vdpa_sim: Implement resume vdpa op drivers/vdpa/vdpa_sim/vdpa_sim.c | 14 +++++++++++++ drivers/vhost/vdpa.c | 34 +++++++++++++++++++++++++++++++- include/linux/vdpa.h | 6 +++++- include/uapi/linux/vhost.h | 8 ++++++++ include/uapi/linux/vhost_types.h | 2 ++ 5 files changed, 62 insertions(+), 2 deletions(-)