From patchwork Tue Aug 2 09:49:49 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: 594852 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp4201613maz; Tue, 2 Aug 2022 03:03:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uMIpDuzWZf9CXfqu0sqZAqof/IPAZv+16uAhG5ao5Z4fYH+LjVjLS6sJ6SyaB4H6XaucYL X-Received: by 2002:a05:620a:2809:b0:6b6:5909:fca with SMTP id f9-20020a05620a280900b006b659090fcamr14973692qkp.607.1659434596667; Tue, 02 Aug 2022 03:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659434596; cv=none; d=google.com; s=arc-20160816; b=f7FJkuBoq8JRgxfm+ODfQYQO9g/LtHhXRXFt9NCWEQizG0zzYoPyUtwXbXimiXWnRz 9O0C1EPmgUuFUmdLTzMY93Bn/Fud1KHm/m1d2LcQQPqR1tectGkyiiEuQFY9KDQe/MCo LzYumc2FrOuyP3ghn3wwBp9QlT3rxU8DTws+cnWXSidB+QtzXtbVctvV433EMjAEJ6zr zd4lq1lM7deMaP+/4hzbv/6IfawOqaUsVQNnRiiHPaZqRewAhBi1usMjRWMtsqKhxcFe FvS9GFGrTap3jZkpEqkAjB5ef5ru0p2UGGPYxQTL20kvR7Y4fmj/b6cAomYSROGwfVXf A6vQ== 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=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=ZSS84aH5n2t8QR8larl6kGkPNuNii1xksmqWqTTMLSUFCDs1Oem1E+sx4Dd1NWoBs2 ShpS8RLFSjTgRGugwVsjK2l53td4XoyQcvjsTIuGDvwC4YgT4Ha0hxNDya5UcqNGlBRD WnAaAuXFE6YW1CMqE3v7N3vuuXZDVqJItSGhDcMPB1xzOcq2mzP2GmTk8GMfTag+MamJ HZidLFn9NzUN+Av3QyRu42GEuQ9c7z2UWzQm3NgXFXn0VJtEeQXWzDicr6ztsClXTx6W 7HHhopuSWOuFQL2ZMe10xEajeITDyR2VygdZKh2eDZV0cK6Q1zq63aZexajZLLjh+JtK VTjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DHW+C+RY; 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 r22-20020a05620a299600b006b8973f3736si5254452qkp.629.2022.08.02.03.03.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Aug 2022 03:03:16 -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=DHW+C+RY; 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]:43284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIok8-00059O-6r for patch@linaro.org; Tue, 02 Aug 2022 06:03:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIoXb-0001HG-5j for qemu-devel@nongnu.org; Tue, 02 Aug 2022 05:50:22 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:50935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIoXZ-0002Mv-4I for qemu-devel@nongnu.org; Tue, 02 Aug 2022 05:50:18 -0400 Received: by mail-wm1-x32c.google.com with SMTP id v5so6974712wmj.0 for ; Tue, 02 Aug 2022 02:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=DHW+C+RYNg6EOZJGS3DZi+htxLKjA8EWA92xqqdFN35ZUbyFIWjn5yNO5fHTTx/4Zc 8wGXW6wFRKOHu6jLqCE3i+mOVlH4rTsrlHO6BG5yyeuPstI7QgBLtQU9UPC56a91pF64 sefORvWjLZhxJFpqasRPTXH57mgOUr/vbpDTxifDHUVbsvyso2zvLrwYaBGBLm0utLQi Wjnqa91CMkfKQNOyFeMvDMSPRtfVtp7yzHAVRwCZAGnt8GAlMvu3NVEeFia/QuDKFmT1 TmfY5juQJDb6gE5Z50BhK7XauXcg2gWd9ikG0DdCH1wW3KbPQUbFs9eg0QH/8vfoSWvf 76rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=Sxi86RbGcpI2KkNSyQqieoE0wrZXmXmPIJF5/wm0NrkvqFezVyz+cj6JtLAiwDQ39G kjx0zLKBOoiR4t5W5fb9XxvRAqaVBC8UQ/XzF4117BaVss76uXTHh5sCFykaKvY4wcNj VtFFsidaXGbq0vv9krFAwYG25/VyRj38SGs8b5W1aweHdZc4IZhMKym1vJ+9hHUOtmcf eH+BXl0GKEheZ25FatCFm+ZJCdxbG83biJBpJIA6WVCfnqjSRLxGg2ZefurL78PbZ8ez eVvmfWpchttCrRgS167Cm0gaU7sSOp1Payjza+dl/mdgDSXPbmxKjPNPByJghm6Xf401 e1eg== X-Gm-Message-State: AJIora8HX2IYL017DLg0p7q6N/TKOWyIy2SKZQ+Hvs30Hn1GXvu02XGc 2hWLXuSbwffztQiWNqZUaMjAPA== X-Received: by 2002:a05:600c:1ca8:b0:3a3:19c9:5448 with SMTP id k40-20020a05600c1ca800b003a319c95448mr13759641wms.40.1659433815022; Tue, 02 Aug 2022 02:50:15 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id o12-20020a05600c4fcc00b003a31d200a7dsm19650559wmq.9.2022.08.02.02.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 02:50:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CA8501FFB8; Tue, 2 Aug 2022 10:50:10 +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 v4 01/22] hw/virtio: incorporate backend features in features Date: Tue, 2 Aug 2022 10:49:49 +0100 Message-Id: <20220802095010.3330793-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220802095010.3330793-1-alex.bennee@linaro.org> References: <20220802095010.3330793-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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" There are some extra bits used over a vhost-user connection which are hidden from the device itself. We need to set them here to ensure we enable things like the protocol extensions. Currently net/vhost-user.c has it's own inscrutable way of persisting this data but it really should live in the core vhost_user code. Signed-off-by: Alex Bennée Message-Id: <20220726192150.2435175-7-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- hw/virtio/vhost-user.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 75b8df21a4..1936a44e82 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1460,7 +1460,14 @@ static int vhost_user_set_features(struct vhost_dev *dev, */ bool log_enabled = features & (0x1ULL << VHOST_F_LOG_ALL); - return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features, + /* + * We need to include any extra backend only feature bits that + * might be needed by our device. Currently this includes the + * VHOST_USER_F_PROTOCOL_FEATURES bit for enabling protocol + * features. + */ + return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, + features | dev->backend_features, log_enabled); }