From patchwork Tue May 24 15:40:41 2022 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: 575737 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp2414022mab; Tue, 24 May 2022 08:48:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqaI2o/Z1nqN9RjtC05RF9LbOg1dPEa69jXGHyrPiuWdGTNejSn9+wLHOA8r8S8rcIBdam X-Received: by 2002:a05:622a:81:b0:2f3:c0d8:d630 with SMTP id o1-20020a05622a008100b002f3c0d8d630mr20572055qtw.599.1653407280065; Tue, 24 May 2022 08:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653407280; cv=none; d=google.com; s=arc-20160816; b=1Bv0ew1ufwJjcVyMGuCQcCfGOafzNv2sl+SdEyAJf/iIEIax7ZppYjnxIf7haqYiP2 0UnEU1P0GctE2GSZdsCcG4HgNzb8C8pMborsnGmLczWcKL6kXcgKM0Y+lCDystC962Xd q6TFkiaQpYTc5EbcKnoTgUYWbbmpcAqcwxFZToRCKOPxGOimemFvf6XVcUIyJDHRPrGR 2He4KQJX/3HUwrjSDLJb3Y/rbOm4Cu7tDinXiAEKpFeH3GYrw+tfTx9C1+MQGmX8fNgm wfxh32JR1lbq+nX95QyGl4uD36HTG8XJDU8AbDP5wf+V7VeA77DeFeDluNoACju4dNBq IViw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=5EpRm/9HHK85fo5gZK8auBcL4vBK6z84dOJ/Zm0/w68=; b=CDdFXaaiD6opP87/y4vkI2p8ML7OD9yNU3WiHFFMNgN78ZLEYx5yjuUoFO0wRjK/tX exIAWzoH6AeKNf1Yhu2FPHwY64LOIgmAntHyR6dkG30eCvGJDdEaw8CZC7rfNXpKuWkS QKGrznTcGkhajXJ5doP8izKGyV1ATEd7KtdS1s8TXUzFDsDTKJCvpzGuJhXfb7IKxl26 kwYaZ7UjgTJG1urUl0t7t85K4u3M6oNqtpSVifx0dJjkuvkAUjs78ArIf1ETQCOoCjil eJu+ud3cYx9MBHKqFhYIAB0EZJRlxGRFCT8k+T6yqxTHYU0XRzEj71cYAJ8SY9YEzMTL oS4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H3B6QgaI; 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 w15-20020a05620a424f00b0069ff8bf3094si4833935qko.345.2022.05.24.08.47.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 May 2022 08:48:00 -0700 (PDT) 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=H3B6QgaI; 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]:51890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntWlL-0002qU-JI for patch@linaro.org; Tue, 24 May 2022 11:47:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWei-000403-A3 for qemu-devel@nongnu.org; Tue, 24 May 2022 11:41:08 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:45596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntWea-0005Ll-CE for qemu-devel@nongnu.org; Tue, 24 May 2022 11:41:07 -0400 Received: by mail-wr1-x431.google.com with SMTP id p10so7649078wrg.12 for ; Tue, 24 May 2022 08:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5EpRm/9HHK85fo5gZK8auBcL4vBK6z84dOJ/Zm0/w68=; b=H3B6QgaIWPXzjDwGh7xqUtBVD6vxaaLK46FQHGxyes1+ACsXyM8RHc17XPKSgU4/Tf +Z6k6d+ohqxiBq4q/PkodHO+SsQUa+eAiNZPwCwtfeVxFnVFn42gdMLiA8jEpMfzoKWk jhTx34as0hmYqQJ1tuZm0Qt57udqXEQk7SJd5esszWYVcdB68jP13S3W9icf/A45yuQZ oZ2Oz4syPUE/KgLirD4SRvucJrsxikONRaPV3vsxYPPyqfVfWeIghkomiSTNo3gdr9ZA Sc1ZRUbpKaaN46WCW1xFayodx6qhiyiroANeX5zJbOUAtXPGntZ/RpWOR/evIO9CKGK9 wSOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5EpRm/9HHK85fo5gZK8auBcL4vBK6z84dOJ/Zm0/w68=; b=LcaYCfREZNPKi8TzXpVNaw2r4Xk5oyQKh567NpEsQy5tztBDnfuenAH5QAYbN2KVTv fRXlsNX+fnNMBMQ+KAuoc573Pr+9gq4btDblmdxWvEH74WYXBEXdoct6NnayTbxFk8Eb ogXaPziFzJz1H/a6x2FTduzMpOFqDlTF472g6XF5oqhGX7mUwq9oqV4k1jXuI3b5WCEf IXPjsiJATuUjnI1cHEW4grrRLeDKRNTBHwsNm4FB5khFdpE4DBZguw7CwVpga4xuQnrv tSNQGszcWvvehC75DJpalVJ+HKTgQC8ajzJMId3mcdV6ZYEZFesFqu3jBnm+MmqfFkw7 7e2g== X-Gm-Message-State: AOAM533Ht/rSY4D/fEai/jHxMydpu5ekGSuulqZSrGIGlJFSlrFJc8ap L8BBI3uDCGTyg45W0WKs+ZJWKw== X-Received: by 2002:a5d:6984:0:b0:20f:fadf:8849 with SMTP id g4-20020a5d6984000000b0020ffadf8849mr1086144wru.143.1653406858077; Tue, 24 May 2022 08:40:58 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s1-20020adf8901000000b0020c547f75easm12886935wrs.101.2022.05.24.08.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 08:40:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 624CF1FFB7; Tue, 24 May 2022 16:40:56 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: slp@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, stefanha@redhat.com, mathieu.poirier@linaro.org, viresh.kumar@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 00/15] virtio-gpio and various virtio cleanups Date: Tue, 24 May 2022 16:40:41 +0100 Message-Id: <20220524154056.2896913-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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" Hi, This series ostensibly adds virtio-user-gpio stubs to the build for use with an external vhost-user daemon. We've been testing it with our rust daemons from: https://github.com/rust-vmm/vhost-device Getting the test enabled took some doing most likely because the need for CONFIG support exercised additional paths in the code that were not used for the simpler virtio-net tests. As a result the series has a number of cleanup and documentation patches. The final thing that needed fixing was the ensuring that VHOST_USER_F_PROTOCOL_FEATURES didn't get squashed in the negotiation process. This was the hardest thing to track down as we store the feature bits in several places variously as: in VirtIODevice as: uint64_t guest_features; uint64_t host_features; uint64_t backend_features; in vhost_dev as: uint64_t features; uint64_t acked_features; uint64_t backend_features; and a number of the other device structures also have various features fields along with get/set function handlers. It wasn't super clear what the flow through this structures was meant to be but I'm fairly sure there is unnecessary duplication in there somewhere. We could certainly do with some docstrings to make the point of each field clear. Going forward I wonder if having a fake vhost-user daemon is sustainable in the long term. Maybe it would be better to spawn real vhost-user daemons in a test mode so we don't end up duplicating the whole protocol? Anyway please review. Alex Bennée (13): contrib/vhost-user-blk: fix 32 bit build and enable include/hw/virtio: more comment for VIRTIO_F_BAD_FEATURE include/hw/virtio: document vhost_get_features include/hw/virtio: document vhost_ack_features tests/qtest: pass stdout/stderr down to subtests tests/qtest: add a timeout for subprocess_run_one_test tests/qtest: use qos_printf instead of g_test_message tests/qtest: catch unhandled vhost-user messages tests/qtest: use g_autofree for test_server_create_chr tests/qtest: plain g_assert for VHOST_USER_F_PROTOCOL_FEATURES tests/qtest: implement stub for VHOST_USER_GET_CONFIG tests/qtest: add a get_features op to vhost-user-test tests/qtest: enable tests for virtio-gpio Viresh Kumar (2): hw/virtio: add boilerplate for vhost-user-gpio device hw/virtio: add vhost-user-gpio-pci boilerplate meson.build | 2 +- include/hw/virtio/vhost-user-gpio.h | 35 +++ include/hw/virtio/vhost.h | 21 ++ include/hw/virtio/virtio.h | 7 +- tests/qtest/libqos/virtio-gpio.h | 35 +++ contrib/vhost-user-blk/vhost-user-blk.c | 6 +- hw/virtio/vhost-user-gpio-pci.c | 69 +++++ hw/virtio/vhost-user-gpio.c | 357 ++++++++++++++++++++++++ tests/qtest/libqos/virtio-gpio.c | 171 ++++++++++++ tests/qtest/libqos/virtio.c | 2 +- tests/qtest/qos-test.c | 8 +- tests/qtest/vhost-user-test.c | 179 ++++++++++-- contrib/vhost-user-blk/meson.build | 3 +- hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 2 + tests/qtest/libqos/meson.build | 1 + 16 files changed, 872 insertions(+), 31 deletions(-) create mode 100644 include/hw/virtio/vhost-user-gpio.h create mode 100644 tests/qtest/libqos/virtio-gpio.h create mode 100644 hw/virtio/vhost-user-gpio-pci.c create mode 100644 hw/virtio/vhost-user-gpio.c create mode 100644 tests/qtest/libqos/virtio-gpio.c Acked-by: Thomas Huth