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 B4C27C05027 for ; Thu, 2 Feb 2023 09:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjBBJJp (ORCPT ); Thu, 2 Feb 2023 04:09:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjBBJJn (ORCPT ); Thu, 2 Feb 2023 04:09:43 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5E1F5FD3 for ; Thu, 2 Feb 2023 01:09:41 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id n20-20020a17090aab9400b00229ca6a4636so4985027pjq.0 for ; Thu, 02 Feb 2023 01:09:41 -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=10hCW48KPbvjfvXEjrjQ+Mgg8cpIPYTv4D/tTAJDTFA=; b=8EMNDhCqTbFttbka/+TAiSeV5HrHEpPPTDWCdd+pC75E+2UqrAgvMajQc0EkjbagyX 9n/0ZfjnRY8rUa+nIoXcW7SqLt4UxhjTntX5RNDx0A4bTmCkZ1dUofksYyMCwUplG0ZK khdSJiOtcrutRo1WdLqkenS+9CMGQ52nG60Rw+43cN28AWgHp3X0vKj7xoOdW4Oij+p2 PH1+Hqzp/LlbRe+bNIAeHcitIsnEfGKgqPxC1LNuG6nP3gu7h+TNyhPGv7CGuOaksqsB xEFUWl3qxYUaT3dz2n9sGR8Fx60EGP4Xk6Tcmx1lhpa+jY/tS/gNaQb+fyrgR2X0Xx7v KQmQ== 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=10hCW48KPbvjfvXEjrjQ+Mgg8cpIPYTv4D/tTAJDTFA=; b=1ZmR4Zz8/ZeIN7Had5fVphlexHoyKWnHkptUa5IhkFrXySj+54+Kd6B5v6zclHwBIt OnK8b5lx/LMLpUCB4nnPnuSkDVZ/6d3M5KTl7FxTy8X0Gpsgi1oVgKjycMgP2NFQjM0N nhxK2eOB5gWp4FUxGpfIoLGApQGeWXdoIIFpTLDGgdP8Cj7JIdM2CFrST5o4SC3UK+Vs O5h6mPrSdvXUZhgQgRvvADisekZZYHuexZT9gRMpGCNAMJUhwU5F4mMkmmUuqfTDh5CM xOjwRKT4cgZSFnYGPuSA1lFVRJPkRdBBpeZf8noo5Cmf0AcsuJbpTZp5y1u2vRAyHC1A MDiw== X-Gm-Message-State: AO0yUKXVhwA1pUAv5/ODR6sOLOSRZc2/RccSQa9TXK6Sszi/1VyoFR6B DU6daMibfpN/EwvZXbddRU5KeKX8JbLZE7Dl X-Google-Smtp-Source: AK7set8TRDrnyQM34c60qrfKukf3YMCoIk81aVwwaJ/9ofFNhvBNL5Xdej/Gen3KhJgGunl2ZBfRDA== X-Received: by 2002:a05:6a20:6987:b0:bb:bb46:bb9e with SMTP id t7-20020a056a20698700b000bbbb46bb9emr6437176pzk.39.1675328981236; Thu, 02 Feb 2023 01:09:41 -0800 (PST) Received: from tyrell.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id ik12-20020a170902ab0c00b001929827731esm13145968plb.201.2023.02.02.01.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:09:40 -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 v2 0/7] Introduce a vringh accessor for IO memory Date: Thu, 2 Feb 2023 18:09:27 +0900 Message-Id: <20230202090934.549556-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. Also changes of drivers affected by this patchset are not included yet. e.g. caif_virtio and vdpa (sim_net,blk, net/mlx5) drivers. This patchset can separate into 4 parts: 1. Fix a typo in the vringh header[1/7] 2. Enable a retpoline on virtio/vringh_test [2/7] 2. Unify the vringh APIs and change related [3, 4, 5, 6/7] 3. Support IOMEM to vringh [7/7] This first part is just for typo fixing. The second part changes build options of virtio/vringh_test. The change bring the test close to linux kernel in retpoline. In the third 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. v2: - Add a build options to enable the retpoline in vringh_test - Add experimental results of the API unification v1: https://lore.kernel.org/virtualization/20221227022528.609839-1-mie@igel.co.jp/ - Initial patchset Shunsuke Mie (7): vringh: fix a typo in comments for vringh_kiov tools/virtio: enable to build with retpoline 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/Makefile | 2 +- tools/virtio/vringh_test.c | 123 ++++--- 5 files changed, 357 insertions(+), 642 deletions(-) -- 2.25.1