Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10782199rwd; Thu, 22 Jun 2023 04:58:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77bdB0iyveX13KQFPjrfdr5IuO3I35mfty+ZD62etr+Il9Wrzx1VsyLCIOuPNINhsq+hrt X-Received: by 2002:a05:6a00:1482:b0:65e:ec60:b019 with SMTP id v2-20020a056a00148200b0065eec60b019mr15466363pfu.25.1687435136691; Thu, 22 Jun 2023 04:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687435136; cv=none; d=google.com; s=arc-20160816; b=FT2QeBrUyVnsvGCUiWQQibnGccB5qOjTr4HU1erp71UPnqVorqTzVlSXgK1H+ODS1m 6OnWX76keYfPpPammNoD5RjVvqCK8OQQOBIW/tpQwOBEZ2X1c2FcWHR+h2m9kLXLjXcG ZKDc/ZiDMB06vB8iqrrEw2LAI/J8LoiV56ZzsE2picjsrS/eENFj58Yz62rxZsM/pL/C Myem37q6M3x4AF1uocqtjx5xkp/Kz8+kr47mJMBrgVZP8kgyyemirOiuKGhmMVrPp+oI JJ9MEvoyDX7sWCo5009Bmm+GuUvexkkZPZXX1sjHuMMFyknRU+HZKn3TNw4ce5KsLXfs Auhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=W7SKEzo0tiPtjA/r8jOe2vPyIc6DKSYtWpFv1BZVSgU=; b=HdRCNz35EKLGT7niXy89bf8CINDGcW8bfDp0W5fcHS6v10VKflmgoBNgLMYPwhjTn9 uqFZwQQPD5PsnI3fdemgEALFwgpxGv1dj1KMlSeadXpA3MEGYGvDXXh6hUURG9fxKFMC 3Nkfga6UFEkwu5mnjrjhi2Ymbn6MgK3TTALlR38QTbOR1VFf6s1kWhzc/j5AamuMmg65 jUloc+1DrmDQ03lvOK0vaA2edhI+TuHIJFe4FV6zOOFkEEKYDiDyGXN2ntJti3SmDnK3 XoFhs4NVO44FkOvGWfuenF6+0r3N8qN95qrXLIodp791X7P4cAA/r0sf6soeSWgSbToF icQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KdZ3vmEl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a637518000000b00542924cbf75si1625401pgc.235.2023.06.22.04.58.44; Thu, 22 Jun 2023 04:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KdZ3vmEl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjFVLj5 (ORCPT + 99 others); Thu, 22 Jun 2023 07:39:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjFVLjp (ORCPT ); Thu, 22 Jun 2023 07:39:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 804B81FC6 for ; Thu, 22 Jun 2023 04:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687433839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W7SKEzo0tiPtjA/r8jOe2vPyIc6DKSYtWpFv1BZVSgU=; b=KdZ3vmElMF0HaY3HDgoP54qaWF6TkFdZ3I80m0SwoYejP4MUeBoDYGc+K7Hf8S6xou3wJd oRt7Y+vVRww+UT1zL6XL4kXxIm/ov6oYF6ey/whWVqQKu7EXCHy6vuVqJextVFYgNN5TRY Jpah9yQcjwKnwgW6HJ2LhH4jwFpDUeY= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-502-gEs23B0GNUKBXlGXwVwP-g-1; Thu, 22 Jun 2023 07:37:17 -0400 X-MC-Unique: gEs23B0GNUKBXlGXwVwP-g-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-98843cc8980so468833966b.1 for ; Thu, 22 Jun 2023 04:37:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687433836; x=1690025836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=W7SKEzo0tiPtjA/r8jOe2vPyIc6DKSYtWpFv1BZVSgU=; b=UHklVPm8MmT0BgZap6qCpXly9xJuU1LqnYazdIEDVYsONbVVh/C0ylDP8O2dewR+wY KyFU3lc7ogwgJnEzJkgBci35Ohg/KnPn7no47T2h+oW5nbMNDGbxa1M8G3TwrQKLwLb7 hlwTPE5KQ9jlwv51TuhBlolRj1SXf0SH7/lEl6E1p1wDcijF5sW+bu7KIqhIxhZbXLWs DUUmASb0r/YBYMmiSGsaggt3gVSSPtxCGhYvGVDlQgvOA1FsYVz5dJ07oFdyLadC/+n0 8bcWkCzcW2Kq3PPwqm/9xK2UVtIfRLQbeh8ZemzNC07gJuR/G4vOA6V+Vh2krKEgI1xW VyoA== X-Gm-Message-State: AC+VfDzCJuz4uhtO/iZwQRwV+gmbYJ+jlowRU8pqu7QhDzsYzHyAJLbB hiLe+cWwItuiQC02mKmUEDeAvIweTFBH83qUmT657WDGXQ4b9R0vaEp3zTBDoWHLwhnYECwklLf rYmvPFlT0WGKisamCQRj7V2Am X-Received: by 2002:a17:907:9810:b0:96f:bcea:df87 with SMTP id ji16-20020a170907981000b0096fbceadf87mr18311950ejc.42.1687433836423; Thu, 22 Jun 2023 04:37:16 -0700 (PDT) X-Received: by 2002:a17:907:9810:b0:96f:bcea:df87 with SMTP id ji16-20020a170907981000b0096fbceadf87mr18311937ejc.42.1687433836129; Thu, 22 Jun 2023 04:37:16 -0700 (PDT) Received: from redhat.com ([2.52.159.126]) by smtp.gmail.com with ESMTPSA id l11-20020a170906644b00b00988956f244csm4586680ejn.6.2023.06.22.04.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 04:37:15 -0700 (PDT) Date: Thu, 22 Jun 2023 07:37:08 -0400 From: "Michael S. Tsirkin" To: Stefano Garzarella Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Jason Wang , Eugenio =?iso-8859-1?Q?P=E9rez?= , Tiwei Bie , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature Message-ID: <20230622073625-mutt-send-email-mst@kernel.org> References: <20230605110644.151211-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230605110644.151211-1-sgarzare@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > don't support packed virtqueue well yet, so let's filter the > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). > > This way, even if the device supports it, we don't risk it being > negotiated, then the VMM is unable to set the vring state properly. > > Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") > Cc: stable@vger.kernel.org > Signed-off-by: Stefano Garzarella OK so for now I dropped this, we have a better fix upstream. > --- > > Notes: > This patch should be applied before the "[PATCH v2 0/3] vhost_vdpa: > better PACKED support" series [1] and backported in stable branches. > > We can revert it when we are sure that everything is working with > packed virtqueues. > > Thanks, > Stefano > > [1] https://lore.kernel.org/virtualization/20230424225031.18947-1-shannon.nelson@amd.com/ > > drivers/vhost/vdpa.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 8c1aefc865f0..ac2152135b23 100644 > --- a/drivers/vhost/vdpa.c > +++ b/drivers/vhost/vdpa.c > @@ -397,6 +397,12 @@ static long vhost_vdpa_get_features(struct vhost_vdpa *v, u64 __user *featurep) > > features = ops->get_device_features(vdpa); > > + /* > + * IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support > + * packed virtqueue well yet, so let's filter the feature for now. > + */ > + features &= ~BIT_ULL(VIRTIO_F_RING_PACKED); > + > if (copy_to_user(featurep, &features, sizeof(features))) > return -EFAULT; > > > base-commit: 9561de3a55bed6bdd44a12820ba81ec416e705a7 > -- > 2.40.1