From patchwork Thu Jul 28 13:55:00 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: 594075 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp546665maz; Thu, 28 Jul 2022 07:26:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t4ZvVnJVQLX1DO3nj38VMVkYA84bzicIV3gMHNnqCuRLDk0YxGjeA+nPEO+r7IsoJY8UH8 X-Received: by 2002:a05:620a:190c:b0:6b6:3ca8:a453 with SMTP id bj12-20020a05620a190c00b006b63ca8a453mr20105852qkb.174.1659018400077; Thu, 28 Jul 2022 07:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659018400; cv=none; d=google.com; s=arc-20160816; b=00BnCSrYgBjFqBx8rSMdr6AN0GmHmZYLAbqQHqD9AvjwKOzKu65lSxCOkOEqXRx4pt 0ScoAHrYpI/hKf5vBFipSR+RIqjvcJzqWbxeMSZFO2yQunE7IJvcitJiUAgsQ7TuVNgu 8sVDGeDwe900cMyMbToD6OVl3AS2mipBrdLnryXRzPzchooNVDILRfO4S8tAjUkPjJ+t mq82rVq/BttD6ZwmakoLTC9iwvUNCTqPVTByGow61C8nPzAioo1zGR8ihxxhKtTI9V+m UF5KZPuZiG9kCs7S0nk5hmY8i6+F+dutu8Exvh65eXozcxIxvMJoOW4Z6c+FXg+G59sy bucQ== 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=o+acVhMc6cGyDTnCLziaQHD0y+GY8sAr5Y6fAeeHG6du3keFmI6H6FFlGtV22PTa6b duZovZ5kUF6mFbBne0bTb1PD/6kDTB0VZyMacbPvyPK/QBmyewqnj/ciiz6OvCnK803J r56+xUUogGZ9oKoft3NCo7G1//8cjlQISrkAXHJ8tPi2FuaX821kpNhgoY752D0DJoMi EJgLz9On1IgqudOB+WsHeepM/1x3PaEyYGOe9UkIScpqB+tAIoyMPV7QTpSVHhPXj6is QNijh8n2MdXBUbWs/nWwVCDv93tpS8uCW1ZXThBmzl1SxJad/FLvF8WaOYHyNLl2YqFS 2BlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kb1xxsEz; 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 y126-20020a376484000000b006b5cd7e5c23si505229qkb.283.2022.07.28.07.26.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jul 2022 07:26:40 -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=kb1xxsEz; 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]:35388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oH4TH-0006oK-KY for patch@linaro.org; Thu, 28 Jul 2022 10:26:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH3yy-0003lT-6R for qemu-devel@nongnu.org; Thu, 28 Jul 2022 09:55:21 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oH3yu-0000Nf-Jm for qemu-devel@nongnu.org; Thu, 28 Jul 2022 09:55:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id u5so2295335wrm.4 for ; Thu, 28 Jul 2022 06:55:07 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=kb1xxsEzQrWgYuE2LMINFYLvrfst53N1FSmkhmBZM5MO1Sf3yZ1DaaNLnIAspPktEr ZowhjUlj2EEvVaCi/L5sEL0LO3caPfxFse0PQ53R1w4MfZdiI6rlb9Vvpz5w42k1t6DC DC+Fzfmvawm3cANMWmAB3W8h4J1TlfmxNfnnwxiVVaB5ec2TGC3OzlBpREUXvyrF4gLQ fcWEapJgh2OkKQBrbLD4R2RecCNbiUAJZGlcfv9wquM3VLE7LXXpbUnG+scdL3x9oeGz gbZs6YLnRZEg309Zrrkt4NyZ5tILOKmitD1WpNoCxm2p3ZRtWtyx/XiskPMvvWrLFD7C TD+A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=BOIDMrGfZ+c/EXX/GnapKpQWV69L+JQZnV26jNFSEWwGLOhYtUaV7s1/NwUJajbGjL PTcklEYMN49Y3Fw7tWh160Rt8TJmFTb8ET9JSyKdnTmfWIa4k6ZD8ky0cAkdeURaHQiQ x+I6RrVy2shL2EPrlytk/UZFZAYf35KIRF1EfQalzlJaMZaYbssPIGWkFy9MiXyYMjuY UY07YIMOTwifQHaOfTTYr4rKrLTKiy3P/MHKGTDawFFnpHTfC/Eop35gGQDKadfmVtuW 02UW2SsnARkBSRFC0FRT4/cbNqdQXW8sXUOGyNCzPL7/2qGjoogLE2R3u9ZHgg25z/Fp yITw== X-Gm-Message-State: AJIora9XG5A3s8PX09EN8s/zAqXy1R619Q7MpApWGx8ra2L3GRhqROX2 QSCfCUvg0VfyOC+v9BpNqmi2/z5txNG81Q== X-Received: by 2002:a05:6000:78b:b0:21e:a0fd:ce with SMTP id bu11-20020a056000078b00b0021ea0fd00cemr8658386wrb.309.1659016506054; Thu, 28 Jul 2022 06:55:06 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id v11-20020a5d43cb000000b0021ec76a0c36sm1005656wrr.106.2022.07.28.06.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 06:55:04 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AE7731FFB8; Thu, 28 Jul 2022 14:55:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 1/4] hw/virtio: incorporate backend features in features Date: Thu, 28 Jul 2022 14:55:00 +0100 Message-Id: <20220728135503.1060062-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220728135503.1060062-1-alex.bennee@linaro.org> References: <20220728135503.1060062-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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> Signed-off-by: Alex Bennée --- 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); }