From patchwork Tue Nov 7 18:02:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 741917 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1765431wrr; Tue, 7 Nov 2023 10:04:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBrymCpLJKme0GPng8L4pl3yK81gwHKjcVPCoP9zsZT8HXH5OhPLjFxMTVHE3ilatUm2JW X-Received: by 2002:a05:6214:29c9:b0:647:4060:1074 with SMTP id gh9-20020a05621429c900b0064740601074mr38678026qvb.22.1699380272199; Tue, 07 Nov 2023 10:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699380272; cv=none; d=google.com; s=arc-20160816; b=yaeKhEPZtTCEX905n8S8P0nVK4D0K899QI05TDOnwNvbuGP23VPtPD4GpGmA7jmZq5 X424XCmi1lvlwDjJMBem+Hd/8wEUANTBqhcUjvUmCqBoFJ3E92rzwgLPRnPGnD1v19PV IfjeQ9I0Tf7nRdhcxmhGoFlulstmFvTgAWm3JnCKhpfRDDIYiHMWcnZHjm3eznofBbzz 5ivd1+jqr+1zKa6JYfTal3CRemRVSjU8i9yIglWzOu1JDjMMW9JsOKas/lwoni6UMi6h sEv6o3LLofmo381cKNH3sN77MhfwfPAZW85BAzorVi1PKNn9OAOiJsIvD+QNLOuzX+bK zAlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DjrsuQ6/uCHQnudTjxdx5KRWGaPot2PzYlmZFPHERhk=; fh=TJJmyUUgRcCZXtFwaXktCcgbc+ZTKj0atn5yhJf6P90=; b=p3a3tU2s2mBhmJJOh058+Aa4ZbrPMBuv8nlhPA0cCP1K30CGDLeFRIcVKCQabckltt yRtleK20ho9tSkfGtMreZW6sG6bDAh1klZjNhvdFtWTNLDCcboeTn8iWGS94qZbZ7V/X b3sKFCa1I2W9uaQt/NwjAiYG/I3hhmL6ZWJV1Jr2IOONGLJf2/g57QAFze3B2qINFo69 dDoRWsRJ5+EAWu+5UkMJSL866gJJ/fNaf/os3vJhK9Ctuskdb8I2CVe2pLRgUu15O1EV +LiBdE4s0+FBK5c8hmvKN+VeWkvc6082eHSEwPjuZioaNIUDwaWrO3IsQ5L7nDqDusg5 TCQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2hR++1X; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u14-20020a0ce5ce000000b0066d20f29e50si194270qvm.46.2023.11.07.10.04.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 10:04:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b2hR++1X; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0QPr-00088h-U5; Tue, 07 Nov 2023 13:03:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0QPg-00086s-Kt for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:02:57 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0QPe-0000gn-2R for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:02:56 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32f7c44f6a7so3553538f8f.1 for ; Tue, 07 Nov 2023 10:02:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699380172; x=1699984972; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DjrsuQ6/uCHQnudTjxdx5KRWGaPot2PzYlmZFPHERhk=; b=b2hR++1XuG+00xF0uQT69YHlWwL12N+KDYJtLcHjKwvHUAaM0QKGEK9AvXVk6tQVnx 8TsQvMiWl7nzoY1fU+uw7GaClnNzZuUDD/iZq4VFcJgiGpXJwId2lkKfZcqv/BTYJVTn 3fLDGX2gJZRHGLrqWa2nAUkb7quTUv9DgczFu7reMflZmtvuLCSBVb+0lo7g23K8RnSz x8tb7pL/7E12lTPAp0qxHbdus+hwFdidOQGAkVCq22a6gevwLZeREE8qTvZpHCXXcYEi tRP3/t3JSz4d3ERd2JjRwUPtgyHAKYPeTWknlC0NOm6kPl9Sa8D9hS1zfsYF4mXFDKeh JQdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699380172; x=1699984972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DjrsuQ6/uCHQnudTjxdx5KRWGaPot2PzYlmZFPHERhk=; b=LMwKHnOdwrfeNRVQ89TnRbKpLYMd844qDU94wwyTDig+l2gUgfWy92c06y+ecxGPw9 MxI5eoXkLiED+QPH6mzbj3lWU7ba9fS+i0WzskTY0iOVgr4GJQLvySoVrsuL177BIXd6 d0s6+8OwjnVSEBKM2ktxqhab5HWA9StKUjl2ydxITfxFGMkp0oMjubEaGSJl6MxowbWh Kye3KmzXeJqUN2F9AzVykKIc0El9ZM0lxdF5mawbs/lw2EVe/lkOnLx07ZFBTay+5imT rdT1bhj1aoUFSaCUF75bVLtnP90wuApVrxPVn/kdT7p1omby3xGCVp8tdr7vq7iWgjbT 2owQ== X-Gm-Message-State: AOJu0YwvPw9Dn8K4yLMRzPJj+v3Owdxwpl52FA5/sjP29xr1fwc4FLvF w8S2zjxY2bE2YBGtoLGuqXNDxQ== X-Received: by 2002:a05:6000:402c:b0:323:2d01:f043 with SMTP id cp44-20020a056000402c00b003232d01f043mr37614174wrb.3.1699380172682; Tue, 07 Nov 2023 10:02:52 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id l2-20020a5d4bc2000000b0032da319a27asm2955285wrt.9.2023.11.07.10.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 10:02:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 677016575D; Tue, 7 Nov 2023 18:02:47 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Eric Blake , Gerd Hoffmann , =?utf-8?q?Alex_Benn=C3=A9e?= , Fam Zheng , Jason Wang , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc-An?= =?utf-8?q?dr=C3=A9_Lureau?= , Viresh Kumar , Manos Pitsidianakis , Raphael Norwitz , Hanna Reitz , Erik Schilling , "Michael S. Tsirkin" , Mathieu Poirier , qemu-block@nongnu.org, Paolo Bonzini , Eduardo Habkost , Markus Armbruster , Stefan Hajnoczi , Mark Cave-Ayland , virtio-fs@redhat.com, Kevin Wolf , "Gonglei (Arei)" Subject: [PATCH v7 7/7] docs/system: add a basic enumeration of vhost-user devices Date: Tue, 7 Nov 2023 18:02:46 +0000 Message-Id: <20231107180246.3456598-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231107180246.3456598-1-alex.bennee@linaro.org> References: <20231107180246.3456598-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Make it clear the vhost-user-device is intended for expert use only. Signed-off-by: Alex Bennée Message-Id: <20231009095937.195728-7-alex.bennee@linaro.org> --- v5 - split vhost-user-device out of the table - sort the table alphabetically - add sound and scmi devices v6 - add note re vhost-user-device v7 - fix patching description --- docs/system/devices/vhost-user-rng.rst | 2 + docs/system/devices/vhost-user.rst | 70 +++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/docs/system/devices/vhost-user-rng.rst b/docs/system/devices/vhost-user-rng.rst index a145d4105c..ead1405326 100644 --- a/docs/system/devices/vhost-user-rng.rst +++ b/docs/system/devices/vhost-user-rng.rst @@ -1,3 +1,5 @@ +.. _vhost_user_rng: + QEMU vhost-user-rng - RNG emulation =================================== diff --git a/docs/system/devices/vhost-user.rst b/docs/system/devices/vhost-user.rst index a80e95a48a..c6afc4836f 100644 --- a/docs/system/devices/vhost-user.rst +++ b/docs/system/devices/vhost-user.rst @@ -8,13 +8,81 @@ outside of QEMU itself. To do this there are a number of things required. vhost-user device -=================== +================= These are simple stub devices that ensure the VirtIO device is visible to the guest. The code is mostly boilerplate although each device has a ``chardev`` option which specifies the ID of the ``--chardev`` device that connects via a socket to the vhost-user *daemon*. +Each device will have an virtio-mmio and virtio-pci variant. See your +platform details for what sort of virtio bus to use. + +.. list-table:: vhost-user devices + :widths: 20 20 60 + :header-rows: 1 + + * - Device + - Type + - Notes + * - vhost-user-blk + - Block storage + - See contrib/vhost-user-blk + * - vhost-user-fs + - File based storage driver + - See https://gitlab.com/virtio-fs/virtiofsd + * - vhost-user-gpio + - Proxy gpio pins to host + - See https://github.com/rust-vmm/vhost-device + * - vhost-user-gpu + - GPU driver + - See contrib/vhost-user-gpu + * - vhost-user-i2c + - Proxy i2c devices to host + - See https://github.com/rust-vmm/vhost-device + * - vhost-user-input + - Generic input driver + - See contrib/vhost-user-input + * - vhost-user-rng + - Entropy driver + - :ref:`vhost_user_rng` + * - vhost-user-scmi + - System Control and Management Interface + - See https://github.com/rust-vmm/vhost-device + * - vhost-user-snd + - Audio device + - See https://github.com/rust-vmm/vhost-device/staging + * - vhost-user-scsi + - SCSI based storage + - See contrib/vhost-user-scsi + * - vhost-user-vsock + - Socket based communication + - See https://github.com/rust-vmm/vhost-device + +The referenced *daemons* are not exhaustive, any conforming backend +implementing the device and using the vhost-user protocol should work. + +vhost-user-device +^^^^^^^^^^^^^^^^^ + +The vhost-user-device is a generic development device intended for +expert use while developing new backends. The user needs to specify +all the required parameters including: + + - Device ``virtio-id`` + - The ``num_vqs`` it needs and their ``vq_size`` + - The ``config_size`` if needed + +.. note:: + To prevent user confusion you cannot currently instantiate + vhost-user-device without first patching out:: + + /* Reason: stop inexperienced users confusing themselves */ + dc->user_creatable = false; + + in ``vhost-user-device.c`` and ``vhost-user-device-pci.c`` file and + rebuilding. + vhost-user daemon =================