From patchwork Mon Nov 13 19:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 743485 Delivered-To: patch@linaro.org Received: by 2002:a5d:67cf:0:b0:32d:baff:b0ca with SMTP id n15csp1793171wrw; Mon, 13 Nov 2023 11:03:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaJI5xK7ZAguDGiVsdZuvijD0FN9cItqicCbTzd9icuyC/lvAcqxcyQzdBIgIQgRfB3ylF X-Received: by 2002:a05:6214:768:b0:66d:6311:f91f with SMTP id f8-20020a056214076800b0066d6311f91fmr125431qvz.45.1699902191433; Mon, 13 Nov 2023 11:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699902191; cv=none; d=google.com; s=arc-20160816; b=nUaDzx9ufjMAk3yXhd5yUda9rD3Qck/mZ4TAphH1s4bmYVBe5wQ7TcrCUxCrrQxO+B x0hLoA4VvZs63ATzERIJDVdwyHjwKRB6/blhrimd8Kp6vVzz9bxD7g/8LMZoGQ0jCRWE osKA9tRlZojW8nMxqxeRHHIQEkOh+DC1ubLFrhesowA/9Jym1z5zzuYGWeQtuRH0cNVQ 6Khwmy/xC4/0WxRwWE6UaT/aqXKMVHK06rv1UIMAS+tzBq8+6A1PCiXtvbKAMHYk9E8K KDvVr3/f3/V6MrARktaRzz4njXJ/8XHA3szvAqTJr4s2tbiKSf62nrxShssv14K4AKQR zxcA== 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=FYSYSgbV/GuLcMBTYGrmXS1BeLIkylU92XcqQA40kIg=; fh=j5N4gOp3ka1Xsisgn/3FSSHjf2kwoyjMvxSEx5jWFCk=; b=WcIrho15DG6pUSVLgLwtbvFCRIw05yiImzA9slDr6RGGHJhVuL2HP76ShEtj56+GQh 7BuMByJ1vC1auaH2KlW4Q8CRARED0D8xxppniVao16G7pQ8gkLyHpdg1uK91k60F7GAj 5nNfVyXEVYrxleL7z166YfulwdT+HObL0DGP8XXFxhp2P15/QVR0s99ijAuMBv72nqRX CThN86rZOtv3OchIGAoo5FfAxyR1i4ZbPqa51gGBP3GmmMHQAx7goTcZb02h0ynMKuGM B+VESoCTJAQKIXfE1tlluDmSIGI/7BD+yc/ndhudbOTtlzvnU/3CcYYXv98hDprQ0EBs 3BvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A/l2x5bX"; 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 a13-20020ad441cd000000b0065b20aeaec8si5102248qvq.194.2023.11.13.11.03.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Nov 2023 11:03:11 -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="A/l2x5bX"; 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 1r2cCl-0002dj-9n; Mon, 13 Nov 2023 14:02:39 -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 1r2cCj-0002db-N0 for qemu-devel@nongnu.org; Mon, 13 Nov 2023 14:02:38 -0500 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2cCh-0000L5-7L for qemu-devel@nongnu.org; Mon, 13 Nov 2023 14:02:37 -0500 Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-421bcd0b532so16892841cf.2 for ; Mon, 13 Nov 2023 11:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699902154; x=1700506954; 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=FYSYSgbV/GuLcMBTYGrmXS1BeLIkylU92XcqQA40kIg=; b=A/l2x5bXQoQRjKcmWHve+gCwW40StMbs8HD3VCH2dNZ5LS3Mwp7hxp7lQ0VwXneaIR s9mWzQ+K81EKH6RuJmsSkY6XMBX9NzwsMLvcYuAvaZRkfIKLZ9aDDGQPj4hfOIFzaFoZ G3qF1LR1VyaqtyHbegLuPxZNfszmtwLxBCe8Ye69rBqombAsA5qDvYVxejqkqMla9ZQS nmhsNkr7q1P50EIXCpauyAW2Rhaapp98gKIxPlr12BRiRdRffLWLbQVklK84tZvuNHB0 0h1yZwmWTQ0PVC60PFdc44Yz2Uw+Bd6mPF/YVzLLd3JOqTEBcPED7uuQLreaMACGFfUG LNXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699902154; x=1700506954; 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=FYSYSgbV/GuLcMBTYGrmXS1BeLIkylU92XcqQA40kIg=; b=DRCEp12Vo26oHW5+w/rdmAVVz7lgTRgrc7bttalI7m/6efzy3h6Tml99t38IBdMKTL uNh+DUW1BJ/CzcN7RWK1LKkZUnfsNI56uOBWA4WDxYYuZ69JS9ZayE5bIm+7mFk/LixQ aETYcziV3fWLsZiialES0q5h82knvs57OH4MrEBvBeDVxMZC9QrhgaPKHnAfDjfn84Tl chCSw8IbrU5/FlUzfYrM5gY5KRbrsnyPaakspjpFTxxVVZkrf6glDxMYC6PT5CvuO+ig CCdX0gNKUPZjnwn0U3Nw/3kBEd5ZPbL2t5+UYuhZMMbtbzYOg9cOnuMd+tAtBQwXIlyX Q7+A== X-Gm-Message-State: AOJu0Yy9CLljcgjoOBxqj/Bo3Go3wbZe4CRdX6olYK5c+o7YkJt+dGEv wyiZrxLRq7fSXlTZ6Hp3QhN45FYlTKIvdQqEgCEKgoSHd5k= X-Received: by 2002:ac8:7fd3:0:b0:413:bd3:cda5 with SMTP id b19-20020ac87fd3000000b004130bd3cda5mr9226970qtk.49.1699902154250; Mon, 13 Nov 2023 11:02:34 -0800 (PST) Received: from localhost.localdomain ([12.186.190.1]) by smtp.gmail.com with ESMTPSA id kq4-20020ac86184000000b004181c32dcc3sm2124834qtb.16.2023.11.13.11.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 11:02:31 -0800 (PST) From: Leo Yan To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Gerd Hoffmann , "Michael S . Tsirkin" , Manos Pitsidianakis , =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Leo Yan Subject: [PATCH v2 2/4] docs/system: Add vhost-user-input documentation Date: Tue, 14 Nov 2023 03:02:09 +0800 Message-Id: <20231113190211.92412-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231113190211.92412-1-leo.yan@linaro.org> References: <20231113190211.92412-1-leo.yan@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82c; envelope-from=leo.yan@linaro.org; helo=mail-qt1-x82c.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 This adds basic documentation for vhost-user-input. Signed-off-by: Leo Yan --- MAINTAINERS | 1 + docs/system/devices/vhost-user-input.rst | 44 ++++++++++++++++++++++++ docs/system/devices/vhost-user.rst | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 docs/system/devices/vhost-user-input.rst diff --git a/MAINTAINERS b/MAINTAINERS index 86c649784e..ef72c6d512 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2233,6 +2233,7 @@ L: virtio-fs@redhat.com 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/devices/vhost-user-input.rst b/docs/system/devices/vhost-user-input.rst new file mode 100644 index 0000000000..4ff9dd4b27 --- /dev/null +++ b/docs/system/devices/vhost-user-input.rst @@ -0,0 +1,44 @@ +.. _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 share memory with the guest over a memfd. + +:: + + 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 c6afc4836f..75b40f08c6 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`