From patchwork Fri Dec 2 13:22:31 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: 630245 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp909523pvb; Fri, 2 Dec 2022 05:23:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf7SWRrVTgH8bctYNT+AQa8hsDCBkstuWCquLVvMX1+V72wTPEkzWuS9XD4p2u5uFke31kz7 X-Received: by 2002:a37:5ec4:0:b0:6fb:cf7:6d73 with SMTP id s187-20020a375ec4000000b006fb0cf76d73mr61091460qkb.402.1669987415074; Fri, 02 Dec 2022 05:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669987415; cv=none; d=google.com; s=arc-20160816; b=RxBCd/vs2llZKkVxE1Ec3Dx43wCA6c8W/pcYkynJQWi9UgV4f89WJjYKxIErs1nSUJ 2QthdYhjTMy7kYMtPyjomEEXhsFYK4/XVrEsmLG8TfK7DY7vYtZ6OeL/cx/mEBRd67l4 iZOy/Wi2/mqUHmREKHZt2P0hMb1aiSMjEG/vqhD1CRVedOwuYPtGvTQoJWizxd4JjQX7 qTI/9V9je+mpn5xiN7PYHMI+FdcbuAzVtj2LfJV0NwbfIoOP8d9VFOwMm2u/PP7r4Nq1 gnOIRPAFmoJOQQg73SVW6sbqr4R3hri57zLMzjznRz7+AGerCPmGtDeOx0C5zPamZxKf 4TuQ== 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=5mEXrbLKa/Oco5EuGxFy9+y0gN+AKp0q6NZiAQwDSNU=; b=sKjHg6yKbGfL6BV5c+PUBrJj4yA3/BvyQnsVKdtpQAXAa0T4YYipZ9muiQzhmiXjIr U3s30dsfNSd/s7//Kx3utfw1iygB7jDQaYWF3ROv89/Bj4Tj/wblsTE/OF2l46Iqvj4y 1gvWaYPqLdgL8kIWgn67TUxTKd57LOY9e8Bufcnkx9dFTSrZHLZy1UL6QCzX/Ja5RkKa y9tKfTG+vbnr3yIr0qqAq/EO6xcuKbntlrEpTl8RKKiQC20udtNtNwUgCJyIWQKLXydn W2815Sjtibc0A6KADPA9u4TQOA25058b547pyTMbE3OG0102xsyndb9UJYVyHmXIaqLu 9nTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wzgsIJZb; 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 x2-20020ac87ec2000000b003a5753fa5e6si3789578qtj.88.2022.12.02.05.23.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Dec 2022 05:23:35 -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=wzgsIJZb; 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 1p160C-0004Vc-1U; Fri, 02 Dec 2022 08:22:52 -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 1p160A-0004VS-Eg for qemu-devel@nongnu.org; Fri, 02 Dec 2022 08:22:50 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1608-00033w-SD for qemu-devel@nongnu.org; Fri, 02 Dec 2022 08:22:50 -0500 Received: by mail-wr1-x435.google.com with SMTP id d1so7742001wrs.12 for ; Fri, 02 Dec 2022 05:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5mEXrbLKa/Oco5EuGxFy9+y0gN+AKp0q6NZiAQwDSNU=; b=wzgsIJZbc0kYtZa1fYTMK8x5jzjC1Q5y+tBBgOrrHoCNEpCfJ5omtAXQijrw4sIED5 toCbmSzelcqO+Yw5ilF7q6fX5yscaEsMYtvYL1KuD6VGI+QKMIuAxVBE87dPKltBkgk+ jepeeJ4B5FHMcQscBtQ4FaY1nB3fCzUQF+bd3i/PGdbHHU9ohrHUHLls/AW6Bslg9CCi 1WD1GLqj3z9AKF09cbo9gwXaaT5nUgsKhMVS2ubycLmFBNghewJNLA1auRD8skbM0erd /kCN/pRaFMo7JV7+M6rlsaOCc9rt54K2xdg+LVJdMhWLfHMRGsmzCoaiRDWEuA/q+Ep3 K8JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5mEXrbLKa/Oco5EuGxFy9+y0gN+AKp0q6NZiAQwDSNU=; b=4AG3WOiGSGAurpwmudWrmwEhFljc2yGHF6CqHae50+F+h60yfbcxA7GRuEfc+f/4sw AR6WUBvEP6HmcTaf3LOBgex8Vxbao+8XA6/4If3giZtNtW8qdsehdXKSGBzOh+VkvobC unAMQlLaSlpAktouOWkQUtdu03W4qeL2Xz1Pv82MIeDDHo+JDx2s2CgT9eMjgoH95aG/ 7sE0yAAvCLkPMOEqcr/ZAupwHZ5l1fYzUYYoFXucCHqrmNE3bDhNN9wofaCAYJkqQYVw ucfidBg+M8jTSAV2ZendQpkb33t9MPIXjXbruIefxfLszZCGwtP18/PZD5ErBQxJO+Er tfSA== X-Gm-Message-State: ANoB5pkmnFN3rYE0R2mICMDXERGApSt47JXy+dSJSxHonf+ewpaegskG xqNXLSYWxntvUa6k8VbAJhLaiA== X-Received: by 2002:adf:a292:0:b0:242:2fb2:39c6 with SMTP id s18-20020adfa292000000b002422fb239c6mr7129936wra.229.1669987366430; Fri, 02 Dec 2022 05:22:46 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id h16-20020a05600c2cb000b003c6bbe910fdsm15069820wmc.9.2022.12.02.05.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 05:22:45 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EB4D61FFB7; Fri, 2 Dec 2022 13:22:44 +0000 (GMT) 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, sgarzare@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [RFC PATCH for 8.0] backends/vhost-user: relax the ioeventfd check Date: Fri, 2 Dec 2022 13:22:31 +0000 Message-Id: <20221202132231.1048669-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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 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 While you certainly need ioeventfds to work for KVM guests it shouldn't be limited to that. We can run vhost-user backends for TCG guests and either use ioeventfds or in band signalling. Maybe we should apply the same fix as b0aa77d36d (vhost-user: fix ioeventfd_enabled)? With this change I can run: $QEMU $OPTS \ -display gtk,gl=on \ -device vhost-user-gpu-pci,chardev=vhgpu \ -chardev socket,id=vhgpu,path=vhgpu.sock with: ./contrib/vhost-user-gpu/vhost-user-gpu \ -s vhgpu.sock \ -v and at least see things start-up (although the display gets rotated by 180 degrees). Signed-off-by: Alex Bennée --- backends/vhost-user.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/backends/vhost-user.c b/backends/vhost-user.c index 5dedb2d987..87d43fb03a 100644 --- a/backends/vhost-user.c +++ b/backends/vhost-user.c @@ -21,12 +21,6 @@ #include "io/channel-command.h" #include "hw/virtio/virtio-bus.h" -static bool -ioeventfd_enabled(void) -{ - return kvm_enabled() && kvm_eventfds_enabled(); -} - int vhost_user_backend_dev_init(VhostUserBackend *b, VirtIODevice *vdev, unsigned nvqs, Error **errp) @@ -35,8 +29,8 @@ vhost_user_backend_dev_init(VhostUserBackend *b, VirtIODevice *vdev, assert(!b->vdev && vdev); - if (!ioeventfd_enabled()) { - error_setg(errp, "vhost initialization failed: requires kvm"); + if (kvm_enabled() && !kvm_eventfds_enabled()) { + error_setg(errp, "vhost initialization failed: kvm required ioeventfds"); return -1; }