Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1039093pxb; Thu, 28 Jan 2021 06:44:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6Sqz7CuS+IorNZNUGd7UCuDLX3PGrUWgcwLQBa+IjBZZwbyCNBDPBOygkQwQTV9h7yNy3 X-Received: by 2002:aa7:c3c4:: with SMTP id l4mr14196784edr.255.1611845095430; Thu, 28 Jan 2021 06:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611845095; cv=none; d=google.com; s=arc-20160816; b=pZvCqCEW8sgQHqICEkdhyo6Oi+MP2OZSSUkeS5qZprLHikguWRV8XRfQ6CcHJPdNGG EiFkx5i6XWQaxdXGLiOnlaUFe53LvtTkjS0sSp/TeB45CuvVokm4oyPJWI22OWoywwFN FELPzMHXEB2zSFUYQIYJm/zDfv6Krc5ILMrKnoGUID3m+b7JQDGnVvKICdfeNIQUPsIL mraJkD/PgllWnQOcKpyHLD9SMOto5wHw+nCQoI/jYsawXNeZNxUekppGiHqOjCk7noQU AEaIKTYOgDZETiZclx4rtXrNmMyFtjBh/BiOEFXQ62eOt5sLcrBiwDrkI24/kL2X2L9a CxBw== 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=oKQyktnzCEz0hqPUDHkW7dyXbU3t7aSFEMciUM7CkaI=; b=z1cR+wOTYoBR0GQkajduF7SCclnrlMd8xr/THWistLNrmoh6QcyjyoTZrKu/LkWFCy /l3+4dLsiniNrX898+rwPniL2mjnaLaKBTuwcgwiLAv09t302YbuAX/LCvo3CTJ4zwS9 glypcyMCJe0wDD2uFdQGoSNxo+Ytt6NMwHXEk0KC3dA0t+BHvA9WjKdRHrs026WQUoAP yd35gJUDGBkOOyNsJYRQeSLFA2Yu4prg6s1Ipeae8Ib1XK/zr2xyoXbFXjkLAKuk0dg3 moSHTggGVehuLPGNkq4kmlz1n+sJy26JrdZKJ8Z9NfIjX/P52ajw+PE/zLG4+E3tF4Dv zI9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HwVZl0Lf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb35si2582220ejc.396.2021.01.28.06.44.30; Thu, 28 Jan 2021 06:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HwVZl0Lf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231681AbhA1OnS (ORCPT + 99 others); Thu, 28 Jan 2021 09:43:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60925 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231166AbhA1OnF (ORCPT ); Thu, 28 Jan 2021 09:43:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611844899; 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=oKQyktnzCEz0hqPUDHkW7dyXbU3t7aSFEMciUM7CkaI=; b=HwVZl0LfOL39aRr8cB5UE3rV6dt8r9wX8MzHTPH1hqn8eiZRBpyblputci5yWciPgIuwVH HWuV7h40teLH+LWt199gaPJ6wEZtPfUuS3RSUr6PmjZi14FGrXR0MZxnbjR7vw+dZ1QQ1m ivm7pWYxGDFNidZ95TXusJQM8BZbMC0= 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-360-oddZIRJDMeiHx4rcSfnbdg-1; Thu, 28 Jan 2021 09:41:37 -0500 X-MC-Unique: oddZIRJDMeiHx4rcSfnbdg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 784211800D41; Thu, 28 Jan 2021 14:41:36 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-113-219.ams2.redhat.com [10.36.113.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id 832AE60875; Thu, 28 Jan 2021 14:41:28 +0000 (UTC) From: Stefano Garzarella To: virtualization@lists.linux-foundation.org Cc: Xie Yongji , "Michael S. Tsirkin" , Stefano Garzarella , Laurent Vivier , Stefan Hajnoczi , linux-kernel@vger.kernel.org, Max Gurtovoy , Jason Wang , kvm@vger.kernel.org Subject: [PATCH RFC v2 00/10] vdpa: add vdpa simulator for block device Date: Thu, 28 Jan 2021 15:41:17 +0100 Message-Id: <20210128144127.113245-1-sgarzare@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" Since this series is still a RFC, I used the Xie's patch as is to allow vhost-vdpa to use block devices, but I'll rebase when he splits it into multiple patches. The series also includes small fixes for vdpa_sim that I discovered while implementing the block simulator. Thanks for your feedback, Stefano Max Gurtovoy (1): vdpa: add vdpa simulator for block device Stefano Garzarella (8): 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: implement vringh_kiov_advance() vringh: add vringh_kiov_length() helper vdpa_sim: cleanup kiovs in vdpasim_free() vdpa_sim_blk: implement ramdisk behaviour vdpa_sim_blk: handle VIRTIO_BLK_T_GET_ID Xie Yongji (1): vdpa: Remove the restriction that only supports virtio-net devices drivers/vdpa/vdpa_sim/vdpa_sim.h | 2 + include/linux/vringh.h | 19 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 118 +++++++---- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 288 +++++++++++++++++++++++++++ drivers/vhost/vdpa.c | 28 +-- drivers/vhost/vringh.c | 54 +++-- drivers/vdpa/Kconfig | 8 + drivers/vdpa/vdpa_sim/Makefile | 1 + 8 files changed, 433 insertions(+), 85 deletions(-) create mode 100644 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c -- 2.29.2