From patchwork Thu Jan 4 21:09:43 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: 759875 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp7183321wrw; Thu, 4 Jan 2024 13:11:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOswJmMK4Xdp8+1yrci5tPAajEWdq9jRhXYY5XdPU6lg3F8h/r1zCJWiFTEKLyyLextel+ X-Received: by 2002:a05:622a:550:b0:428:142b:e405 with SMTP id m16-20020a05622a055000b00428142be405mr1630777qtx.42.1704402686481; Thu, 04 Jan 2024 13:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704402686; cv=none; d=google.com; s=arc-20160816; b=AAQjnfW1v6Uzy5pCgz+CIuCA8Pxd7Llc8VED/VzzLg3kBxry6Onay9WliEza+coJYR 5m3BFNILx5ky9A1NFYdtSv/mxPQlfGTckJ2J6so9UDcBqeSm6xXc96Y4cGnlJjkq0Dc3 TmiMCj+k/hE9jw9DIACnOCK9T2/Clfq5uMl2mvecncthnE53ZudBuYQT03qUKY8cWlfc T8CpjIbNA09/tj21jEccSdkYsHfq7k9GwXKpjdFc8Nw3NzuBEHC6q8JHTTqelzKWuH6m e5/kboawCoS096QQrOZ+M7Ja3NjsNA6p4eyvJnoDO1mXA0I0Nuyn75Vw91wphCIyRlBp RtxQ== 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=ObKwt//EhgHompi9v5X1bJx9VVsKykUNbS0pmE1n/mg=; fh=Ud52xLVns4YOXK9oAfV6buiiCgh2jRAKo3BCP7q+jII=; b=J8+2IyFRuCjx66qY6pjR27d6qWTSPk8ObMJ5RI/rRduahWJm42V7mBYjf/2upInhWR 501HI6mZQwEOD/BaTpCiQAJUhcfYSZHfqytPP43OMCDJmDoYHQRmtYR+YSGMksmZpqYc abrVREjlzc3+OZbZoBd2vy74SlpJgu9ixkP0fafKAb9YLdz75BEMHh9ohkTZ44cSXwHY qJ4Ly5TxaFyrjYCbZDLWEnMlMN56EIAAfTEYukqDab/B5LiKyOdJ1ZJwvrfc3JoIW+aw 5HWrVaIcI3C/VfFpG6YdTV7Bct4U4cY6YVpHc9N2IJyS/ajy6HFDrl/ZV0GLU1GONVir 5GIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OU2uwP39; 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 g2-20020ac87f42000000b004283ef47c2asi388249qtk.109.2024.01.04.13.11.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jan 2024 13:11:26 -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=OU2uwP39; 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 1rLUz4-000770-F5; Thu, 04 Jan 2024 16:10:35 -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 1rLUyU-0006wr-Kz for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:59 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLUyS-0007Uy-43 for qemu-devel@nongnu.org; Thu, 04 Jan 2024 16:09:58 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3367a304091so746452f8f.3 for ; Thu, 04 Jan 2024 13:09:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704402594; x=1705007394; 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=ObKwt//EhgHompi9v5X1bJx9VVsKykUNbS0pmE1n/mg=; b=OU2uwP397KAm1ZEdhQjXLEzjpSaCFAc6gk+pwolayN8MsHArE54Zqi5rqu/1UMUIqq dGyR98wO7QLzX1+bzDmBY5QFqxROE7O592BuzpvH/05644C53ojzmOp5Ah8jtba9Y3r1 7YCAx1RZ4u20eVOynwIC76jKwTs/zv7dPVjnrx7W3N6RIPN5zTvunIgJPRh/QpHKWBk9 UUfa9XlypS18DAGjWZ4p7uB2mH3vhwR1ijchLQxDwwJe5hAn5jsljwJTdB81MrpY6gjV GjFA7/w3YqOPQkGJSwOycQS/2Oc1GWqt3g1CLyCjix9hZyHtZuoTk+JThQjSPePKHzKY F4dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704402594; x=1705007394; 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=ObKwt//EhgHompi9v5X1bJx9VVsKykUNbS0pmE1n/mg=; b=xRpuBVyTaHijfX40HFULGqcsWe8dq3l4FuAP8z6CLqkMeNWE1MmAiq320P4BJrkdvE 7ovC/plgqJGAZhGqUYNJcFYB/axuSXBSVW1Mb6P0h/wzJmuoJcFNJTTsgsBkt+uFKmhC lEInkgaVLK4dchYicG2wC1TIM8PQ+9hZZRcQnIVRxlQlhtDbc+tL/3HeB2d995fc/a7u SjSBiR6hIwsVFZ9j+cihrjRfRa2QOYNGmgyppesYwm99NwYU46MlOBijJQCVEanFvwy5 jvDNjRUOXqih4DND6dxnesYZyNzdg1PStktIz6Q6qTIrZHHZMkrkHHQF63MzwjldEcqD vNSA== X-Gm-Message-State: AOJu0YxYqo7YyOsj8riwYMrhr2kn9ubLnEyOimdv/2FU1qumebFaNjr2 f+QMN/7Y4vnvLZEQUPcJuTF87smBCklTWQ== X-Received: by 2002:a5d:4ecf:0:b0:336:6e2f:930e with SMTP id s15-20020a5d4ecf000000b003366e2f930emr407735wrv.176.1704402594551; Thu, 04 Jan 2024 13:09:54 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j3-20020a056000124300b003368c8d120fsm110223wrx.7.2024.01.04.13.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:09:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EFA455F942; 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 , Leo Yan Subject: [PATCH v9 09/11] docs/system: Add vhost-user-input documentation Date: Thu, 4 Jan 2024 21:09:43 +0000 Message-Id: <20240104210945.1223134-10-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::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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=unavailable 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: Leo Yan This adds basic documentation for vhost-user-input. Signed-off-by: Leo Yan Message-Id: <20231120043721.50555-3-leo.yan@linaro.org> Signed-off-by: Alex Bennée --- MAINTAINERS | 1 + docs/system/device-emulation.rst | 1 + docs/system/devices/vhost-user-input.rst | 45 ++++++++++++++++++++++++ docs/system/devices/vhost-user.rst | 4 ++- 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 docs/system/devices/vhost-user-input.rst diff --git a/MAINTAINERS b/MAINTAINERS index 607f71817f8..ff70987aeb3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2274,6 +2274,7 @@ L: virtio-fs@lists.linux.dev virtio-input M: Gerd Hoffmann S: Odd Fixes +F: docs/system/devices/vhost-user-input.rst F: hw/input/vhost-user-input.c F: hw/input/virtio-input*.c F: include/hw/virtio/virtio-input.h diff --git a/docs/system/device-emulation.rst b/docs/system/device-emulation.rst index d1f3277cb02..f19777411cd 100644 --- a/docs/system/device-emulation.rst +++ b/docs/system/device-emulation.rst @@ -94,6 +94,7 @@ Emulated Devices devices/virtio-gpu.rst devices/virtio-pmem.rst devices/virtio-snd.rst + devices/vhost-user-input.rst devices/vhost-user-rng.rst devices/canokey.rst devices/usb-u2f.rst diff --git a/docs/system/devices/vhost-user-input.rst b/docs/system/devices/vhost-user-input.rst new file mode 100644 index 00000000000..118eb78101c --- /dev/null +++ b/docs/system/devices/vhost-user-input.rst @@ -0,0 +1,45 @@ +.. _vhost_user_input: + +QEMU vhost-user-input - Input emulation +======================================= + +This document describes the setup and usage of the Virtio input device. +The Virtio input device is a paravirtualized device for input events. + +Description +----------- + +The vhost-user-input device implementation was designed to work with a daemon +polling on input devices and passes input events to the guest. + +QEMU provides a backend implementation in contrib/vhost-user-input. + +Linux kernel support +-------------------- + +Virtio input requires a guest Linux kernel built with the +``CONFIG_VIRTIO_INPUT`` option. + +Examples +-------- + +The backend daemon should be started first: + +:: + + host# vhost-user-input --socket-path=input.sock \ + --evdev-path=/dev/input/event17 + +The QEMU invocation needs to create a chardev socket to communicate with the +backend daemon and access the VirtIO queues with the guest over the +:ref:`shared memory `. + +:: + + host# qemu-system \ + -chardev socket,path=/tmp/input.sock,id=mouse0 \ + -device vhost-user-input-pci,chardev=mouse0 \ + -m 4096 \ + -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \ + -numa node,memdev=mem \ + ... diff --git a/docs/system/devices/vhost-user.rst b/docs/system/devices/vhost-user.rst index c6afc4836f9..9b2da106cec 100644 --- a/docs/system/devices/vhost-user.rst +++ b/docs/system/devices/vhost-user.rst @@ -42,7 +42,7 @@ platform details for what sort of virtio bus to use. - See https://github.com/rust-vmm/vhost-device * - vhost-user-input - Generic input driver - - See contrib/vhost-user-input + - :ref:`vhost_user_input` * - vhost-user-rng - Entropy driver - :ref:`vhost_user_rng` @@ -91,6 +91,8 @@ following the :ref:`vhost_user_proto`. There are a number of daemons that can be built when enabled by the project although any daemon that meets the specification for a given device can be used. +.. _shared_memory_object: + Shared memory object ====================