From patchwork Wed Feb 14 11:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 772670 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp246178wre; Wed, 14 Feb 2024 03:21:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVGNkFWzV+vQO7VwqlqEBqnH2DaY0nqX3JX5s9a72MFdHeZtEvIQWKnLTL/zlPFQDWDAUIrrJipRew4yaFJunje X-Google-Smtp-Source: AGHT+IESMPdF4yecBeGbUQLnk9ZaYF/c6kb2Pt6FObGVkHHS042BYo2TAYrfcB2ZuQobsxzLUhFa X-Received: by 2002:a0c:e9cb:0:b0:68c:8bbc:12f3 with SMTP id q11-20020a0ce9cb000000b0068c8bbc12f3mr2068170qvo.9.1707909675034; Wed, 14 Feb 2024 03:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707909675; cv=none; d=google.com; s=arc-20160816; b=ih91EMmcgY7jpUyN6N4z66BOqikfqpmC3k81R2o+GMybOXPkaAg9PBvRsnYPKLhGWb k9dCHZNzbsE/KsZ3VXwwz12PVGccHqUhDIKA6Q67gnQrShM1hMRnSWt7zbLFO7NTVKt/ 10K+LuPu9Q4Jc1kMCve4bX/G6vEaHF67hMsvH9SkIiETDbtm59Icq9WwjhEpAoyKIIY4 UyKrI0VwhmhovdM7baf1+xlo5Oo9uj33jtrV2xysMakdOXBGuSPWxd//dhPkI3xz6QFb lccl6/0zgi3zCnFTHRkqsGgrx7pUjQ8sbp4OJ8zG2lCS1yCURRPp01VhkD9DWnU+KMg0 cJZg== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5QCQCVR6jtXXAjpCojfp7A6N/bol4CbLlxWu9xFsRU4=; fh=ZJxtlHO43AEWvPP7n9eUijpETPjNX6i04CjI0TjzYHs=; b=MTY2L2KYboE+amfvPJ4gj5eiQAwOVCq563oRqgqSpIHIGPmDhkiXG4sUQmQZtZUVpX emfiONe3S2NY0LCQDumDvMPgHCRby92noRH8WxktGK2XsALU+sZzJqJSZxsvp/ER7O5I /YLJbmcHDMP2YOGufW49I08wuc00jGhHyINs+GvsDXb1nqD6UtJNQkas3qxrGT0RElrr dPmCxFyXz+jtBdknZ0vZ8gwThwjhS6BWblT/BEhH0WCZ08XQGbV1IW55MIsQn6Vt+ljS E57HEa/neQTau+7qKBkTVz4+BC3MFGh/aizDJRRTHJYWIakMh9FxKruhczf5LLuo2kmE AdIQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BuTkjKCA; 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=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCXldPwpYT25F48pzZEyZCPZLN5KIqTd0ZycBidEP+IqS7n6YncFeBgz2EK+Jue1ksW1ln7CA3PRlb5Nz1+imsYi Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e10-20020a0562141d0a00b0068efbf238f1si1977772qvd.473.2024.02.14.03.21.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Feb 2024 03:21:15 -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=@redhat.com header.s=mimecast20190719 header.b=BuTkjKCA; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDD4-0008Nk-M2; Wed, 14 Feb 2024 06:13:50 -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 1raDCz-0008K1-AD for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:13:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDCw-0006ih-7h for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:13:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707909221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5QCQCVR6jtXXAjpCojfp7A6N/bol4CbLlxWu9xFsRU4=; b=BuTkjKCAEP5qB0I2C/GOO+iY6WsYRi59sQgaKZlPLwokns6+IcV6X0DWEN575sDrzKPPIQ 63J/adWbQJYtH7AuH9SRbbAGIxGJCf5/cBOo7J8uHIMRc/3md5voBTHtRCPU4zYw4GDdNu DhQA6Rzma57e/pAIs2n5iI/9GgOeyVA= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-355--h3i6bQXP5-1Cv83oHOtyw-1; Wed, 14 Feb 2024 06:13:39 -0500 X-MC-Unique: -h3i6bQXP5-1Cv83oHOtyw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-51197d1fcc2so1641518e87.2 for ; Wed, 14 Feb 2024 03:13:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707909218; x=1708514018; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5QCQCVR6jtXXAjpCojfp7A6N/bol4CbLlxWu9xFsRU4=; b=seb+8rNcGDcYWw5qXHxwBp3ANDNrpsf2lJ9ttUJs5GFl6bFcs+nFvhUHcSmL8lFZ3z yZCyXih9qgpFcpABR2I8WuX5Ge7NHkw+jH2pT73sHhi7j7cj51XEItChy//ZZpjmiGGg P+0v31WO73WPbYiIXlE2zs5WmOV+F8RQUCNpfZlIDOFPbxcWDg+zdCc5fW4j8nR3ULff uao2Jcu23leC4o94YtM0pkrN1q3qr9vDxbefAnSIB9EtAltdxLax5n9SohjHWpwJ7XHc jNPGceCcTE1huwW31nILmg5cMAsldTQ+NEdCaXlLDNRkNk9TOKpgr107C3nbsHz2PgLu qPag== X-Gm-Message-State: AOJu0Yx+YlNMlDxFy74p8JSD2NrCXFqbHA8wt9hkpG5gc6WfJKrGuZgi d1b6ihq9VhAC8L3iSlGmquLNGNjIwIPU/V7m8X7PmwX+yt1YUS3zdkiinK4i/OnP7OLjgfeuS0M bhsXoAErfaCQOjepyVRKsJj1YBm9qc9qlEUAQu/IyrUdtX0NAfa0JbUm1J7twvJsPlrq4HYcAsM swTG5iH1iqydtkQR6PsmteMmD11EifRQ== X-Received: by 2002:ac2:5f8a:0:b0:511:490e:b8fd with SMTP id r10-20020ac25f8a000000b00511490eb8fdmr1544597lfe.45.1707909218069; Wed, 14 Feb 2024 03:13:38 -0800 (PST) X-Received: by 2002:ac2:5f8a:0:b0:511:490e:b8fd with SMTP id r10-20020ac25f8a000000b00511490eb8fdmr1544578lfe.45.1707909217691; Wed, 14 Feb 2024 03:13:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVYlb7bwPA6uMGeGkuP/7gMQIYRWVuhYk2bkkMZe7m1/YaZgX7QvPMTcg8JIKF3Bq0oLe7EmMEeA8DTA0hJxwtl/0DX4CmitOeJIMXgq4rBuXp4c6qU3BkZNFxNE0OQZErjKg== Received: from redhat.com ([2.52.26.67]) by smtp.gmail.com with ESMTPSA id vv3-20020a170907a68300b00a3d42c54e48sm518625ejc.153.2024.02.14.03.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:13:37 -0800 (PST) Date: Wed, 14 Feb 2024 06:13:35 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Mathieu Poirier Subject: [PULL 07/60] docs/system: add a basic enumeration of vhost-user devices Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.504, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 From: Alex Bennée Make it clear the vhost-user-device is intended for expert use only. Signed-off-by: Alex Bennée Message-Id: <20240104210945.1223134-8-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 =================