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 E117FC4708D for ; Tue, 27 Dec 2022 02:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232591AbiL0CZl (ORCPT ); Mon, 26 Dec 2022 21:25:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbiL0CZi (ORCPT ); Mon, 26 Dec 2022 21:25:38 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3734D270A for ; Mon, 26 Dec 2022 18:25:37 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so16047843pjj.2 for ; Mon, 26 Dec 2022 18:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XVIHb2xUd8sujupspgAGNpJyN016wzYVPc2YpZ2bDag=; b=R7ffvjAvcrMZ1p1LMq+Euj4OlP/yRK1ztz7vAX2mfWZWhLy4PKsT3r/kZpWE/KmBW8 maRBuG+idbhR+rPlrNYg6m/KIUBBeIiRdWAHBURPpw5pUMX91PKiIOQccdwuVyH4q+Ml 6ASi7GlNpP43gmoUHjJI4V3NFPlkslPkD5Cz6UBuNwjvUlQ1G/K4L9ZLvq52lMix9WkY OUcgrLgcnRiUM6cAiL4n7VLLFeWFn9MOVo/8H6PJgYat7bIGpdd/wOgkYPMUh8g/DxgQ MU2sirbyrMZeyH88qpXiYAtSh7EzDwFJwE7Y/TVUcS1n5+wW7Y7jddzCrcvUAU1l7nl/ KtLg== 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=XVIHb2xUd8sujupspgAGNpJyN016wzYVPc2YpZ2bDag=; b=HY9AUvW8l7QXBusFn8/RvMgO/y3SG+EoDb9b9BcJUISuzRCmOuslNkLM/GwFSuCJ0P cuUTzn9+qczks7PN4LZPpNjQcA4TP7Av1Dbn63FV/OgUh7GqPWuUleAOKTCacA+S5+dL E1mfvFwrCfhTjqYtR2pMAusXCoTwdwSl0HtPDyYUnIK0/IwyhYkTyDvjLLmmC2yfUirp quMYTpeQ8CxgIUia+13o5MF2E3D9pUgM02ovgejfmn45rpAWoqMvz7RkdV9eLPMqm9l+ Z+sbBwlTpVvQluPSp7Ozq7hFAZjvnEWzdvLMdni5JcyuwM6Idzj2BtYMvy77eqk03PCI HFZw== X-Gm-Message-State: AFqh2krUzznG+oKAIoxbIU3H5Ved2y1cO6OTecLW6P8iZmlgWG/dgUyV KXxBJoIRbhrlVTFRxYaPA4t4xg== X-Google-Smtp-Source: AMrXdXuKZS1Ph/IY6Bb5WWpBVaf6Yu1Vdz30CYa7Nf5FAmFaa4UtKH4qrnegeQAYBuEW0rq2BEA3bg== X-Received: by 2002:a17:902:b418:b0:191:1fc4:5c14 with SMTP id x24-20020a170902b41800b001911fc45c14mr20844566plr.49.1672107936658; Mon, 26 Dec 2022 18:25:36 -0800 (PST) Received: from tyrell.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id w15-20020a1709026f0f00b001870dc3b4c0sm2465014plk.74.2022.12.26.18.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 18:25:36 -0800 (PST) From: Shunsuke Mie To: "Michael S. Tsirkin" , Jason Wang , Rusty Russell Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shunsuke Mie Subject: [RFC PATCH 0/6] Introduce a vringh accessor for IO memory Date: Tue, 27 Dec 2022 11:25:22 +0900 Message-Id: <20221227022528.609839-1-mie@igel.co.jp> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vringh is a host-side implementation of virtio rings, and supports the vring located on three kinds of memories, userspace, kernel space and a space translated iotlb. The goal of this patchset is to refactor vringh and introduce a new vringh accessor for the vring located on the io memory region. The io memory accessor (iomem) is used by a driver that is not published yet, but I'm planning to publish it. Drivers affected by these changes are not included in this patchset. e.g. caif_virtio and vdpa (sim_net, sim_blk and net/mlx5) drivers. This patchset can separate into 3 parts: 1. Fix and prepare some code related vringh [1, 2, 3/6] 2. Unify the vringh APIs and change related [4, 5/6] 3. Support IOMEM to vringh [6/6] This first part is preparation for the second part which has a little fix and changes. A test code for vringh named vringh_test is also updated along with the changes. In the second part, unify the vringh API for each accessors that are user, kern and iotlb. The main point is struct vringh_ops that fill the gap between all accessors. The final part introduces an iomem support to vringh according to the unified API in the second part. Those changes are tested for the user accessor using vringh_test and kern and iomem using a non published driver, but I think I can add a link to a patchset for the driver in the next version of this patchset. Shunsuke Mie (6): vringh: fix a typo in comments for vringh_kiov vringh: remove vringh_iov and unite to vringh_kiov tools/virtio: convert to new vringh user APIs vringh: unify the APIs for all accessors tools/virtio: convert to use new unified vringh APIs vringh: IOMEM support drivers/vhost/Kconfig | 6 + drivers/vhost/vringh.c | 721 ++++++++++++------------------------- include/linux/vringh.h | 147 +++----- tools/virtio/vringh_test.c | 123 ++++--- 4 files changed, 356 insertions(+), 641 deletions(-) -- 2.25.1