Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2601450rwl; Mon, 26 Dec 2022 18:33:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXu2031ghtHAuaQ1ZjW4dR6TfJa1uIibc8xsYsPLHvp4fAfvPgWY00e3cIROvoK6bad4I0s4 X-Received: by 2002:a62:1511:0:b0:577:ad:49c5 with SMTP id 17-20020a621511000000b0057700ad49c5mr19104033pfv.9.1672108420276; Mon, 26 Dec 2022 18:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672108420; cv=none; d=google.com; s=arc-20160816; b=KoXfNxEUueJ2kQaXR3qzFT/XkF0LLRm246hTpDjKt6GAEZGRyiKC75x0aQk+ZCBXez x6l5XlXtGfPA1XhAyDL259GYsXergb7D7KvQkIhs75zUjdPWk28mpzSjjtiB7UApZZj5 eXTNA7eETFvtrnmGNQCuQdkUr37rWuItJ4pbbk9Ptt86rQGmE/VG6jodgcDR5nv7NI9u Bsd/hvAiJUZMST4JM9Mr4xT41SW76IDxePFlpx7D4NpHA6LNlfAzOCs5ogj16z8UomMX GiONDyDsJJWWkxHDqpTIV7pnb0vFs554DGsG6c2BkB+PJllBZn14Ks9/z5PHpW00U+Nr 3geA== 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=XVIHb2xUd8sujupspgAGNpJyN016wzYVPc2YpZ2bDag=; b=U6+UbG4QuRN7G814yxMvhPv4dJ/f7SyuQ8wEIg4qVUM9FVtPucWIkCIKM7tZbqhzqL xhhnaM2mD7R1mhkNuucgHtE9JRYK9VG2QvJXkRaYaPhaokpNKdtx4zUPdTxdYo3jV9RD GTBGN4H0N1Wek+3VL1+rWDA32hjw841H7Nw6EU+ItlV8bIDzbayIk4JYdMyD9CSYTsTJ s9gEwYJouOOsq521q9ogUNw5z0DOmlq1MQKxntYbqxqAU9T/UdOqz5c+hZd0ntYNDuja NQzVxTgLMBOkkA37QGLNQyWWkZ+jmhj6UFK4l2k5m+vrm+Z1ljsu0O1SB+t6F09samhc YOjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=R7ffvjAv; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056a00218300b0056ee105315fsi13941963pfi.178.2022.12.26.18.33.31; Mon, 26 Dec 2022 18:33:40 -0800 (PST) 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=@igel-co-jp.20210112.gappssmtp.com header.s=20210112 header.b=R7ffvjAv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232587AbiL0CZk (ORCPT + 67 others); Mon, 26 Dec 2022 21:25:40 -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-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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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