Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp715516pxb; Tue, 5 Apr 2022 20:02:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxodNnvO5cJFdgcvW5cT7XGaXPkt665FWiTt8baGv1uQiujWf3phqTeFClzTiuPVyd+s8a1 X-Received: by 2002:a05:6a00:982:b0:4fb:806f:4833 with SMTP id u2-20020a056a00098200b004fb806f4833mr6726268pfg.30.1649214151302; Tue, 05 Apr 2022 20:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649214151; cv=none; d=google.com; s=arc-20160816; b=HuGk2aJ7FXmV4aTq+96bhZF1NIoDN6ZIo/Jywjtt+RO8LnO2zPEwXjKrdNRTtKG20G filo1p0chyv6o+ke3oDnCeIz4Z9Oa5Or143ZiP4qE2HZcghdVq4nzAmdUIYu0VwfeohR /1AAcKEo7u9oRVGmGuUaexc0W5L9zXMHtI/o9ZQXgc92wLt8HyjimTa0hXugfmw8QbrU Fjj5NLcm9P1nB1Xon4kOY2tM0VAkouXBmvlI5UY+uvz6Lpy1kZQ2QKFA/0tp6VPhvv48 oEDfPTlSIcfae/JlEO2onq7g4CwQ2jwEvt+oUSaUcj/33H8XxRH/Qa8yhvpwvjpcwXyO lYpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9aNGe8mhDj++3BOIDv5mb4P9Gr6jQ6miTREmRwU3lTU=; b=UBTyzMvPO4ZEBR66BaTwL9y1hHoO1awT4l2M8tHjTvwdT0vglwATpATrcck1AgGten ncZlvVDWRHSL1dNvyQWyvqgWrSyaQzW+VIYH1l33CfbBlcxZp4CrYlpsXiUwSv3d6WEK NbYMwxTtVeoqkLw7iY1W6649aPktj5OjSmqoZ6VyR4BwCQCuuBMnpBqw1gMwzDUAWU0I olbCu0566uZDMWeGdlLVzX16q6iQCASaQzoRtNjQJ2BcvTlDXY8FkG4UEMvckjD3VXZx sMNuYDGad1bhUYzoljLR/rMWoZ+pQUcpsnlEx0PB5NlVavvtozvk7YjIFk26J+xYN9dW NkAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s7f1DiwQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i11-20020a17090a64cb00b001c6fdf85547si3562941pjm.88.2022.04.05.20.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:02:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s7f1DiwQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F7418FE5D; Tue, 5 Apr 2022 19:47:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390264AbiDENhx (ORCPT + 99 others); Tue, 5 Apr 2022 09:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344122AbiDEJSS (ORCPT ); Tue, 5 Apr 2022 05:18:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED61521E09; Tue, 5 Apr 2022 02:04:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A43C61003; Tue, 5 Apr 2022 09:04:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C271C385A0; Tue, 5 Apr 2022 09:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149462; bh=d7UCBwQEaTY8MrbFc29WL+NlLOS9fxPm1wuHsv6tbLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s7f1DiwQC+0rnaIhfG/xVSrNvHmcXwEK73mBJb9lDMeR4c6TTv7M52pn7cTnEcfUI ITtHKA/RA0EZw4MUMSr33K9/Qy0TG/uQvAIgWlvnr2C4p/1enwjANtMfeJ0n8ShVrf v1MUQrluvfN9ACu6kbKX4bRNvaZj22Oibf/3bCtk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Michael S. Tsirkin" , Stefan Hajnoczi , Stefano Garzarella , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.16 0724/1017] vsock/virtio: read the negotiated features before using VQs Date: Tue, 5 Apr 2022 09:27:17 +0200 Message-Id: <20220405070415.757179269@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefano Garzarella [ Upstream commit c1011c0b3a9c8d2065f425407475cbcc812540b7 ] Complete the driver configuration, reading the negotiated features, before using the VQs in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/vmw_vsock/virtio_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index fb1b8f99f679..4a8548bdf86c 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -622,6 +622,9 @@ static int virtio_vsock_probe(struct virtio_device *vdev) INIT_WORK(&vsock->event_work, virtio_transport_event_work); INIT_WORK(&vsock->send_pkt_work, virtio_transport_send_pkt_work); + if (virtio_has_feature(vdev, VIRTIO_VSOCK_F_SEQPACKET)) + vsock->seqpacket_allow = true; + vdev->priv = vsock; mutex_lock(&vsock->tx_lock); @@ -638,9 +641,6 @@ static int virtio_vsock_probe(struct virtio_device *vdev) vsock->event_run = true; mutex_unlock(&vsock->event_lock); - if (virtio_has_feature(vdev, VIRTIO_VSOCK_F_SEQPACKET)) - vsock->seqpacket_allow = true; - rcu_assign_pointer(the_virtio_vsock, vsock); mutex_unlock(&the_virtio_vsock_mutex); -- 2.34.1