From patchwork Thu Jan 4 21:09:41 2024 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: 759874 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp7183158wrw; Thu, 4 Jan 2024 13:11:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSa5M799BUOBJ5wtl9QfDqC4mbXaY3/nOvrg1J9993RIbqrPqvr3fG0XBZdZv4Lid0JZRK X-Received: by 2002:a05:6214:19ed:b0:67f:c943:6359 with SMTP id q13-20020a05621419ed00b0067fc9436359mr1253225qvc.72.1704402662377; Thu, 04 Jan 2024 13:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402662; cv=none; d=google.com; s=arc-20160816; b=AGnyxbtEozUCQaDBJKZekH3Ts+WJ2R2uRU0QKb4RKVHrdKbWifdETYGftDEDQNG2gM 0ljOkyyHLvI3+AeLiMinZQ0bjkEgH7fd0jfZZxudbIl8817pwr7Jk3VDN2nm5gndkKmX M9zI6rqejoFJdD6X5NPtpHmLnSSnnh4Ps0LjNvM10x7LMe6KAWOk3E+CXq/eLpMgwv+c 0OpkMym1HjZvh+QOXAo/nkiTll810Cu9qX8hyCJ5QAM/JQ2dxku8pdXdJ52MF4gCZ9XE bRKXcmu74yODbDoecuVkSpMfSW/eZ0A3+Zvj8t+WYFMcf9UkNqGwTb1gS62p+S4tWgRM CSSA== 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=8OfSNqfYw1yegwimMaKEPeX4MqQs2j01XgstIe7tBng=; fh=FJgCuuUiQlhQb75y4DqgTcYU/2dmCchdcJEae1kKAEw=; b=DwBl2XwnDcHG4yJRxXJ6z6rgMi6yqmyb7Etf4BVMSEf3zKtxS2YwbNRQaONR79Osc+ +T3uTD12zuYh22m8aeCVbPgmvkjxc0Ti3gUXB+GgdkBPLDU6Sz0PzUbG39sJqs2H4BJl OStzNRKLEGqAZC3DIwclHwwrD0oEe8fGCDu29CEiHJvjztNRFmtZWmMEUANNCnBAElBC Qr7zR4viuHv88+CHRTPxJ0KiB0kFvr9+txYoicLdw30hYdr7QbAt4py8Dwo4VYIlNClH sWHKbYrpU9L550A5R0OREfzKXL1ZmEaDG+c+hYIVLtjuwIEndHEDn1eNQsoHr6pUHZdr hgDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mflICYL1; 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 f3-20020a0cf3c3000000b0068080216cafsi291792qvm.369.2024.01.04.13.11.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2024 13:11:02 -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=mflICYL1; 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 1rLUzJ-0007Ek-JF; Thu, 04 Jan 2024 16:10:51 -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 1rLUyQ-0006ve-3d for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:55 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLUyN-0007Rn-UL for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:53 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40d5f40ce04so9136485e9.2 for ; Thu, 04 Jan 2024 13:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704402590; x=1705007390; 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=8OfSNqfYw1yegwimMaKEPeX4MqQs2j01XgstIe7tBng=; b=mflICYL1syYT6P0n9kPkT5tIBC2rHnhMSj7I1jmhCNTR5GEGjm2OXTthVY4k1dogoA keLEa+m2hxCjxPo00R2RGZNjwxMdOxmX51utcjORHh6SlcAyKWCYpq7sbptUL51C3PlG 1zTJvh4nncFkoYZlcLlpj6vkZZasmeudFPO+JS1imYeYcugL2xwfi5qHWMaqe7kOSayg SqurIQx/wSLe8JUYn6CVHFIR1rqafoHAKVtwobHR8woCbV71nnVEjK8OZEE6H5giAW9X Mw23DSXZLcB70Dxf4XncPIgEPcLqqrGfYn9Bshwn0W+RitmgiikJuhUu+7lhFLxN5oJj 68uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704402590; x=1705007390; 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=8OfSNqfYw1yegwimMaKEPeX4MqQs2j01XgstIe7tBng=; b=VqOVwGqWznCrv/If3OkOGclqSJKqv8lx98dILCGrmCgwQEBDdKO+G5P6RaUnCbvlnH I/FG7dZDrrNyADR57w8FDtFJYF/ZZAoL02/o+Qv4UB+PaQWQJr28OFL4tmnBtHCoHPlu lbKD0gGKgP8SizrPyqiXtJRYDsz1snxMQHn6svm2MzVvMhkZ1NGGd/5Sd7s3aSwHSRaM 6N0e2A6+RY9EnePH9Htn4lTvTHsOUorN6SEiv1+ETBzWlqaskJO5c5VNzmsq7hmI0K/l 6smK9vgUqXHwkKLPPU+dok41SLbvvgvXkgzddenBdn6WvE1aFwsObaluL0nnlGcKOxtG ECHg== X-Gm-Message-State: AOJu0YzABvl1PKxyadL7TR43wk8vfUnyF2gv6PJyPIgL+zQq7trFl/iE WiRQTj6nAStoD1xRiSKZJzpbjZ7HFC5c8g== X-Received: by 2002:a1c:7710:0:b0:40c:3905:51e4 with SMTP id t16-20020a1c7710000000b0040c390551e4mr676241wmi.68.1704402590483; Thu, 04 Jan 2024 13:09:50 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m40-20020a05600c3b2800b0040d79907acasm6822175wms.26.2024.01.04.13.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:09:48 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C3A485F93F; Thu, 4 Jan 2024 21:09:45 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Mathieu Poirier , Kevin Wolf , Mark Cave-Ayland , Jason Wang , Erik Schilling , Eric Blake , Fam Zheng , =?utf-8?q?Marc-?= =?utf-8?q?Andr=C3=A9_Lureau?= , Eduardo Habkost , virtio-fs@redhat.com, Hanna Reitz , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , =?utf-8?q?Daniel_P=2E?= =?utf-8?q?_Berrang=C3=A9?= , qemu-block@nongnu.org, Markus Armbruster , "Gonglei (Arei)" , "Michael S. Tsirkin" , Raphael Norwitz , Paolo Bonzini , Viresh Kumar , Stefan Hajnoczi Subject: [PATCH v9 07/11] docs/system: add a basic enumeration of vhost-user devices Date: Thu, 4 Jan 2024 21:09:41 +0000 Message-Id: <20240104210945.1223134-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240104210945.1223134-1-alex.bennee@linaro.org> References: <20240104210945.1223134-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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 --- 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 a145d4105c1..ead14053264 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 a80e95a48ae..c6afc4836f9 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 =================