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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1E0AC433E0 for ; Thu, 4 Feb 2021 17:22:47 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 535E464F65 for ; Thu, 4 Feb 2021 17:22:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 535E464F65 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0410427A5C; Thu, 4 Feb 2021 17:22:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZFyyizkLLRHb; Thu, 4 Feb 2021 17:22:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id D5CB9275A5; Thu, 4 Feb 2021 17:22:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ACF90C07FD; Thu, 4 Feb 2021 17:22:45 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id F3370C013A for ; Thu, 4 Feb 2021 17:22:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E1DFF87223 for ; Thu, 4 Feb 2021 17:22:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pnq9ifAmWo-O for ; Thu, 4 Feb 2021 17:22:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id ED86F87214 for ; Thu, 4 Feb 2021 17:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612459362; 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; bh=Zc+XWtfGtASjsMASpHkffR1pL11AhNAnMUdubmKUbE8=; b=HDqF/3CD1/j+1U2Nr7g260J0ChyEqqwEL3QfH1OqilRzY7xcjyu/Mt+7vo+viGXpcGSanI o4lCf8yUU5C7483MXbxnTBbIrRf2Ag7BU5n1vCIHHtOrlUjq7dNeV7lFLogcKtNVQp5FeV kgEKH9bmGYVsVvQwyepNrCRkxKtU4pI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-530-GuaFadePOfu83dcFO57M_A-1; Thu, 04 Feb 2021 12:22:41 -0500 X-MC-Unique: GuaFadePOfu83dcFO57M_A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2E1C879A0D; Thu, 4 Feb 2021 17:22:39 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-113-213.ams2.redhat.com [10.36.113.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4092D1A87C; Thu, 4 Feb 2021 17:22:31 +0000 (UTC) From: Stefano Garzarella To: virtualization@lists.linux-foundation.org Subject: [PATCH v3 00/13] vdpa: add vdpa simulator for block device Date: Thu, 4 Feb 2021 18:22:17 +0100 Message-Id: <20210204172230.85853-1-sgarzare@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Cc: Laurent Vivier , Max Gurtovoy , kvm@vger.kernel.org, "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Xie Yongji , Stefan Hajnoczi X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" v3: - added new patches - 'vringh: explain more about cleaning riov and wiov' - 'vdpa: add return value to get_config/set_config callbacks' - 'vhost/vdpa: remove vhost_vdpa_config_validate()' - split Xie's patch 'vhost/vdpa: Remove the restriction that only supports virtio-net devices' - updated Mellanox copyright to NVIDIA [Max] - explained in the 'vdpa: add vdpa simulator for block device' commit message that inputs are validated in subsequent patches [Stefan] v2: https://lore.kernel.org/lkml/20210128144127.113245-1-sgarzare@redhat.com/ v1: https://lore.kernel.org/lkml/93f207c0-61e6-3696-f218-e7d7ea9a7c93@redhat.com/ This series is the second part of the v1 linked above. The first part with refactoring of vdpa_sim has already been merged. The patches are based on Max Gurtovoy's work and extend the block simulator to have a ramdisk behaviour. As mentioned in the v1 there was 2 issues and I fixed them in this series: 1. The identical mapping in the IOMMU used until now in vdpa_sim created issues when mapping different virtual pages with the same physical address. Fixed by patch "vdpa_sim: use iova module to allocate IOVA addresses" 2. There was a race accessing the IOMMU between the vdpasim_blk_work() and the device driver that map/unmap DMA regions. Fixed by patch "vringh: add 'iotlb_lock' to synchronize iotlb accesses" I used the Xie's patch coming from VDUSE series to allow vhost-vdpa to use block devices. As Jason suggested I split it into two patches and I added a return value to get_config()/set_config() callbacks. The series also includes small fixes for vringh, vdpa, and vdpa_sim that I discovered while implementing and testing the block simulator. Thanks for your feedback, Stefano Max Gurtovoy (1): vdpa: add vdpa simulator for block device Stefano Garzarella (11): vdpa_sim: use iova module to allocate IOVA addresses vringh: add 'iotlb_lock' to synchronize iotlb accesses vringh: reset kiov 'consumed' field in __vringh_iov() vringh: explain more about cleaning riov and wiov vringh: implement vringh_kiov_advance() vringh: add vringh_kiov_length() helper vdpa_sim: cleanup kiovs in vdpasim_free() vdpa: add return value to get_config/set_config callbacks vhost/vdpa: remove vhost_vdpa_config_validate() vdpa_sim_blk: implement ramdisk behaviour vdpa_sim_blk: handle VIRTIO_BLK_T_GET_ID Xie Yongji (1): vhost/vdpa: Remove the restriction that only supports virtio-net devices drivers/vdpa/vdpa_sim/vdpa_sim.h | 2 + include/linux/vdpa.h | 18 +- include/linux/vringh.h | 19 +- drivers/vdpa/ifcvf/ifcvf_main.c | 24 ++- drivers/vdpa/mlx5/net/mlx5_vnet.c | 17 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 134 ++++++++----- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 288 +++++++++++++++++++++++++++ drivers/vhost/vdpa.c | 47 ++--- drivers/vhost/vringh.c | 69 +++++-- drivers/vdpa/Kconfig | 8 + drivers/vdpa/vdpa_sim/Makefile | 1 + 11 files changed, 504 insertions(+), 123 deletions(-) create mode 100644 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c -- 2.29.2 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization