From patchwork Tue Nov 7 18:07:52 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: 741927 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1768416wrr; Tue, 7 Nov 2023 10:10:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEP0D3cT65SMLHbOT6XQ6Iaopi5AOI4A/OuWa2w8Kdkdyyi5K5QnD2JBLb3C2zB/FauzLWq X-Received: by 2002:a05:6000:1ce:b0:31f:f753:5897 with SMTP id t14-20020a05600001ce00b0031ff7535897mr28723930wrx.59.1699380600252; Tue, 07 Nov 2023 10:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699380600; cv=none; d=google.com; s=arc-20160816; b=zD4N6lF76E3pjL9WBhTGNfNwcQdJTNuRRDowdKFWojnUlaEUxdW/LGM1RxuwKdFLPJ rbKl+ECPnGh47ghwkyTKoZK4JtufR88Vkj2+sMrpcsPjkPoFs0gcodE1aBZCT3tL8yaP qMcfKjth/S4SHCREBENpKUFt+ktQaF08qUg5fQ9c8qo/gcMFYAeq2EKzAxkQVHhNzoSV XPLRHxqnCDZJfHQGr/EgW5pH8HzjJ5eo/L8GV13i00IPBpRkxbG5c0Ip87C1fn/5aW+H 7kY9+EGQ12xGlxl8bYD++wSpuiDjZLRbwq+qzXagk+0zL1TZeX2wfFS0zoR9kluxfDg5 o9jw== 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=jKC1LNIfj9tc06yjyzpgfvvZWaBsp45q1uaz/hs/4dA=; fh=8P8vqBg15kEl+uTM0qDnKhkhuRKnATOCo5N33kas82w=; b=DJdFBQWirAE+gwe+K4HUOo0q7Wmpn7nDQCmyOuyRk9Kq4Vv6jhGZVmKy/M1bopLnk1 WFQELSsDlNYbzaE8sVL4KJhEtyW4w01PKWt4+YcBP++AhO05aPCK6MFkINmxDXPgpH24 SKYZivQwCx2P4M8Hyehy0l1WIhXKDfEw6pItzciUbZKdBzvj1LM0JxlTmnfv8wPRCM2R JhuTv7lzy2hdp+Pj0TdonGL2CNTCSyo/z249Y56/iovAYk9BWs5/aNzQ0Z0JW+fIcKUk 4bLOtUMZFOuZKzjY1+5VkJoR10CtWOciWddQ5hUYXz+PFYDzmc0fiQ5bAktUk4mrsRX9 aZnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y5GfEFeO; 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 s13-20020adff80d000000b0032c857eb794si2100158wrp.627.2023.11.07.10.10.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2023 10:10:00 -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=Y5GfEFeO; 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 1r0QUn-0006zi-T5; Tue, 07 Nov 2023 13:08:14 -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 1r0QUd-0006sh-Ul for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:08:03 -0500 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0QUZ-00026y-EB for qemu-devel@nongnu.org; Tue, 07 Nov 2023 13:08:02 -0500 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-507975d34e8so8624813e87.1 for ; Tue, 07 Nov 2023 10:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699380477; x=1699985277; 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=jKC1LNIfj9tc06yjyzpgfvvZWaBsp45q1uaz/hs/4dA=; b=Y5GfEFeO3h0xcqxJ/mknMdFccr5Zpfkkfqvj4XQVWE/fNmylVeG3VyqpNYXWBadE9+ QBgNvpZSYYPHfY3nnznB6Cr1y4aa2TXWrnJHIxHa+q7KyFuvM3/wHxzQaW7JZFbZYS+H L5m6Vjp4HlBy1ZuvHVwwyajDKtKAL5w/W/rSaUxel9TinOEtQ6NgASg/KJRY69vpwTEH RZeIunIMwnG3HB660DKOWNWkXJQE0eOQD8zYZoyiHZL5Gke065VuN86f57EI4b0HK8g0 AAlo3GRruBpZYxoAFduktzw5jVg/aYn/m0/zYYXC2dgdEHga6mz9PxXjOEjhs2y8cNCM xyUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699380477; x=1699985277; 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=jKC1LNIfj9tc06yjyzpgfvvZWaBsp45q1uaz/hs/4dA=; b=gi0arGTSZXDtHvolO0aoRUYhT/D8qJ1+2cKRegcM+QGWboLWy1RtCRB9OHr5GYuejV oKbbbqTwJB8nXXpVii2D8eAZOf7/tGSAR2ozM+1FZ+zinN3KKhMhLHvJXmxWSyf47aJn pfGPK90apCuzqE96sECDkZuj92Lmgt50XM2YWbOZ9ZK1G4vj3qovIFnbt3XaTKq3g+5v 9TIJTtqdOdAQRwVNI22jGXqYIX94ialDCCOlyZ84J9iOMa798QzLpqdu5yGCnDDmOGoj e2jaO+YqYYyCiIGhFqea/jYDChbRbN/nSb+nHJ7ec+sVuDjNG5tZHx+DcYA9Vz5evs/f 6g0w== X-Gm-Message-State: AOJu0YwdlNneL/rZqOvYJdmLoUQpCqeuCAWAkHKohipysDLjzYwBaaLy A2uNAgSBp+VzZYGSG2CJG8n/PA== X-Received: by 2002:a05:6512:3f0c:b0:508:17be:c366 with SMTP id y12-20020a0565123f0c00b0050817bec366mr5870203lfa.21.1699380477236; Tue, 07 Nov 2023 10:07:57 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x17-20020adfffd1000000b0032710f5584fsm2997290wrs.25.2023.11.07.10.07.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 10:07:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 23A5C6575D; Tue, 7 Nov 2023 18:07:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Viresh Kumar , Eduardo Habkost , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Erik Schilling , Raphael Norwitz , Jason Wang , Eric Blake , Manos Pitsidianakis , Markus Armbruster , virtio-fs@redhat.com, Mark Cave-Ayland , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Gerd Hoffmann , Mathieu Poirier , "Michael S. Tsirkin" , Stefan Hajnoczi , Hanna Reitz , qemu-block@nongnu.org, "Gonglei (Arei)" , Fam Zheng , Kevin Wolf Subject: [PATCH v8 7/7] docs/system: add a basic enumeration of vhost-user devices Date: Tue, 7 Nov 2023 18:07:52 +0000 Message-Id: <20231107180752.3458672-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231107180752.3458672-1-alex.bennee@linaro.org> References: <20231107180752.3458672-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12b.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 Reviewed-by: Philippe Mathieu-Daudé --- 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 =================