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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89BC0C4332F for ; Wed, 14 Dec 2022 16:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239041AbiLNQbh (ORCPT ); Wed, 14 Dec 2022 11:31:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239000AbiLNQb3 (ORCPT ); Wed, 14 Dec 2022 11:31:29 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD83A6160 for ; Wed, 14 Dec 2022 08:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671035442; 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=MvzKkMsF15Ii2v8T6zm7fsybd7ToFL1MzDuE6XhV9TM=; b=X42KlIpvwyLDWyE7XyyY2ikOE6OeBIM8rQSv9Nnl9MKRzfQru/IN3/bzNAO9QQ7koPgsUo BplRZMqNoGjRSjCyn07qrG595kw6XlcSBlLdASfv0Cy+Nw5zlDM3zhH/DrLa9THpwPXUlb MJ/Mvdyb9R+gbUpg3K+ydACDKEyGzLw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-247-f45xvxT8NXCBWf_Tz3vnyQ-1; Wed, 14 Dec 2022 11:30:29 -0500 X-MC-Unique: f45xvxT8NXCBWf_Tz3vnyQ-1 Received: by mail-wm1-f72.google.com with SMTP id bi19-20020a05600c3d9300b003cf9d6c4016so917962wmb.8 for ; Wed, 14 Dec 2022 08:30:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MvzKkMsF15Ii2v8T6zm7fsybd7ToFL1MzDuE6XhV9TM=; b=yXakH7oT2hkrCO8RfCpinX//nygrKP7rQ1hagsLvW+iwqy/mZH0wJToeIfT2Us+kOn 5Hgt+1PIIeZPkEMWfX3OMtmxJeWTpALuLaxtm2n+EG2ciLUpRNBc+nJnaQx2iBiRxPoD cydlZm6c+dRB+vXoJ3JXJKe1Ugc+vAqOiatX2DcXs1MaJ+kOT3eLILeqOo6osMH5rE+X kV6/HlOt8bZA3SB+O7ivKVmi70sS49u7WSCSi00NcTNgCTvFPB2gmDqTGucbSAmhXzoX zEN/LHxhn0x56JJDZWiQc81CvJKOO3tIC6dWr9/bbicLt/tQSS25AxQ8HCTykNEBr3A8 rw/w== X-Gm-Message-State: ANoB5pnX5AmC8HOA38rdMQGlz3qEl8UghOF2k9ld/BcU9o2yWVsOiyF5 lw3SvxAn8sslNXd0FA7XJaxHHBE1UElEaApKcwWnKvkqjo2q88vboCV1/2jdnf3WhRtOHLP3H3z frtj1fMVDJLoyH3Ae6Ov80IqR X-Received: by 2002:a5d:470a:0:b0:242:d4f:96c with SMTP id y10-20020a5d470a000000b002420d4f096cmr15025768wrq.0.1671035428443; Wed, 14 Dec 2022 08:30:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GfaS136t9dUD0TzONcVTtwml5/pPsXD/CEUDFgE57pufF23Sy+4PdxYOWCLOsS1OfTnwS5w== X-Received: by 2002:a5d:470a:0:b0:242:d4f:96c with SMTP id y10-20020a5d470a000000b002420d4f096cmr15025759wrq.0.1671035428229; Wed, 14 Dec 2022 08:30:28 -0800 (PST) Received: from step1.redhat.com (host-87-11-6-51.retail.telecomitalia.it. [87.11.6.51]) by smtp.gmail.com with ESMTPSA id e17-20020adffd11000000b002422816aa25sm3791759wrr.108.2022.12.14.08.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 08:30:27 -0800 (PST) From: Stefano Garzarella To: virtualization@lists.linux-foundation.org Cc: Jason Wang , Andrey Zhadchenko , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Michael S. Tsirkin" , eperezma@redhat.com, stefanha@redhat.com, netdev@vger.kernel.org, Stefano Garzarella Subject: [RFC PATCH 0/6] vdpa_sim: add support for user VA Date: Wed, 14 Dec 2022 17:30:19 +0100 Message-Id: <20221214163025.103075-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.38.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for the use of user virtual addresses in the vDPA simulator devices. The main reason for this change is to lift the pinning of all guest memory. Especially with virtio devices implemented in software. The next step would be to generalize the code in vdpa-sim to allow the implementation of in-kernel software devices. Similar to vhost, but using vDPA so we can reuse the same software stack (e.g. in QEMU) for both HW and SW devices. For example, we have never merged vhost-blk, and lately there has been interest. So it would be nice to do it directly with vDPA to reuse the same code in the VMM for both HW and SW vDPA block devices. The main problem (addressed by this series) was due to the pinning of all guest memory, which thus prevented the overcommit of guest memory. There are still some TODOs to be fixed, but I would like to have your feedback on this RFC. Thanks, Stefano Note: this series is based on Linux v6.1 + couple of fixes (that I needed to run libblkio tests) already posted but not yet merged. Tree available here: https://gitlab.com/sgarzarella/linux/-/tree/vdpa-sim-use-va Stefano Garzarella (6): vdpa: add bind_mm callback vhost-vdpa: use bind_mm device callback vringh: support VA with iotlb vdpa_sim: make devices agnostic for work management vdpa_sim: use kthread worker vdpa_sim: add support for user VA drivers/vdpa/vdpa_sim/vdpa_sim.h | 7 +- include/linux/vdpa.h | 8 + include/linux/vringh.h | 5 +- drivers/vdpa/mlx5/core/resources.c | 3 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 132 +++++++++++++- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 6 +- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 6 +- drivers/vhost/vdpa.c | 22 +++ drivers/vhost/vringh.c | 250 +++++++++++++++++++++------ 10 files changed, 370 insertions(+), 71 deletions(-) -- 2.38.1