Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7071082rwd; Tue, 6 Jun 2023 06:06:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7eZL6Vm0WvNizy3eQ+kENDtEBOvmbKwRs7/F2jJNsT+7yLqF/pjtm52mKnhYpy9QKQyNDy X-Received: by 2002:a17:902:db03:b0:1b1:99c9:8ce5 with SMTP id m3-20020a170902db0300b001b199c98ce5mr12617981plx.16.1686056783546; Tue, 06 Jun 2023 06:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686056783; cv=none; d=google.com; s=arc-20160816; b=PR0nv3I9G1opitXyDsouUwj8HpUthHTyG2TZDzFBZfh5myq3F03+cvUIGCdDyVCICY GK+DvIgOrPmn/aTCcoircJRBMMJTNpmISYf1fy1dG4eC1AkND4iFssH1xbUmVRjWV4j+ WnTIvBAY9uWbOxJo6XOCqgxNXCT//bEThBVFG0f5+iYm6Y3aa6hyCKhq0b5e1UHUJvLe uMBqVWThyGzZMnnH4GEukiwjaK2cBwzLGwB1SHHiEzwjpwzLu0ZMKWDBtjYBH3VGzIxf jtiFaX3k3zypnetNBvsA1JxGAEtN8zUxFrPfsillPAmmDLbvLNbCr6rop5Q+AExMsZ7r 2aCg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=dtuylhemCFrocIQz72z/IvBRItNMZNPZwOBB6roSRDM=; b=cWaXDiUwKPs9rsxohJIwGdIEr44mkhC27RVYeS9rSja6JO0+y7UO5OnT7lUbbxeOry MCpY6L8O3bFQBXJxSmyVPN3MICFBQ2PAVzeUonkHhmGwRVYaSrTYhjMbJbpzwZki6fgE p1e+4GyewJaHj//SkSGdb74Jf2UZtY2MHnBPZ9mrXjf8p8+oLYoTmukqc9scQf7Vud1o o70eXXItL9S+0I5M+D0ZuP+TVFv3rjzzv87Ck2ZrppKmIXmkWOocCjRWMUjImMABY7bY gf99LbtaIYUTNi2M4gAmCKEk5gTBqfk4rJ0C8Kh2Qs9ytTLdU3Oaf1F23U4L3M9Z6Mp9 wXTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VMQ+Roar; 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 m5-20020a633f05000000b0053b8f80c656si7577399pga.781.2023.06.06.06.06.09; Tue, 06 Jun 2023 06:06:23 -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=VMQ+Roar; 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 S237272AbjFFM7Y (ORCPT + 99 others); Tue, 6 Jun 2023 08:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbjFFM7T (ORCPT ); Tue, 6 Jun 2023 08:59:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E525310C7 for ; Tue, 6 Jun 2023 05:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686056295; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dtuylhemCFrocIQz72z/IvBRItNMZNPZwOBB6roSRDM=; b=VMQ+Roar/LRQZyjUSGQq/wpJkzdCHsZ2NNzjluy+ipew6O43Gnuiwoud+Mxmsaeyi3pzyx agTH1wyUPHIU3HmWNv70mQJHLBekU0brpjSN+UjoRSRR43IaAntHiZLXVwjRhtqs4lNYjD lgpgjm6NgZcVfdcfOLGHjkBvEzIOwGs= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-tmugchH6OJ-PYVehtJctbQ-1; Tue, 06 Jun 2023 08:58:12 -0400 X-MC-Unique: tmugchH6OJ-PYVehtJctbQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f41a04a297so29789185e9.3 for ; Tue, 06 Jun 2023 05:58:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686056291; x=1688648291; h=in-reply-to:content-transfer-encoding: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=dtuylhemCFrocIQz72z/IvBRItNMZNPZwOBB6roSRDM=; b=ZVL7S1mjNOXLFu6813Z+22zaQ4Ov16ul7p4DGPnmLiVbNHbJ8Nt2OsphvCG6hXzz9O QB9jhGK+583kQ4YV+exqyzrqHIATwB7h3gp22DLzrdfiNsGoNyTS+tzpcPe3uT0gxGTE wo9k0XvJEJaRz6RytVGvXYvXhMI8Mxl0MH7pcitO6/3wImGqXXREA4/XNUGDyLr16g5Q frgTqlpwMYOKH8pPHRthEBj2HplbURfJzirP6CnAGbGTH8jGYaLZcwJ8bInIvcJbXi0I 5531d4tL3qG1fx9VLcSw9gl2fQjtJ93hqojnYxqV8Mh9oCaBTql9HI69uamzBFFkZzLa 2slw== X-Gm-Message-State: AC+VfDzBi1kUbsSoEslJ+3yxdAOpFWZpie5Heu2TQC4wp3ZkStWIMizm +f40YPvF4Vj7ZX1clYEl0LQkhgbJ+bPrK1SPgF3JN6VbDUGjX82iHxHio00p1NcHbOjTZrvqeOY RWCCDojiZHDkTSjHslXGnWmFx X-Received: by 2002:a05:600c:3797:b0:3f4:2492:a91f with SMTP id o23-20020a05600c379700b003f42492a91fmr1985694wmr.27.1686056291606; Tue, 06 Jun 2023 05:58:11 -0700 (PDT) X-Received: by 2002:a05:600c:3797:b0:3f4:2492:a91f with SMTP id o23-20020a05600c379700b003f42492a91fmr1985683wmr.27.1686056291295; Tue, 06 Jun 2023 05:58:11 -0700 (PDT) Received: from redhat.com ([2.55.41.2]) by smtp.gmail.com with ESMTPSA id q25-20020a7bce99000000b003eddc6aa5fasm17487714wmj.39.2023.06.06.05.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 05:58:10 -0700 (PDT) Date: Tue, 6 Jun 2023 08:58:06 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: Stefano Garzarella , Shannon Nelson , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, 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: <20230606085643-mutt-send-email-mst@kernel.org> References: <20230605110644.151211-1-sgarzare@redhat.com> <20230605084104-mutt-send-email-mst@kernel.org> <24fjdwp44hovz3d3qkzftmvjie45er3g3boac7aezpvzbwvuol@lmo47ydvnqau> <20230605085840-mutt-send-email-mst@kernel.org> <20230605095404-mutt-send-email-mst@kernel.org> <32ejjuvhvcicv7wjuetkv34qtlpa657n4zlow4eq3fsi2twozk@iqnd2t5tw2an> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Jun 06, 2023 at 09:29:22AM +0800, Jason Wang wrote: > On Mon, Jun 5, 2023 at 10:58 PM Stefano Garzarella wrote: > > > > On Mon, Jun 05, 2023 at 09:54:57AM -0400, Michael S. Tsirkin wrote: > > >On Mon, Jun 05, 2023 at 03:30:35PM +0200, Stefano Garzarella wrote: > > >> On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: > > >> > On Mon, Jun 05, 2023 at 02:54:20PM +0200, Stefano Garzarella wrote: > > >> > > On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > > >> > > > 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 > > >> > > > > --- > > >> > > > > > > >> > > > > 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/ > > >> > > > > > >> > > > I'm a bit lost here. So why am I merging "better PACKED support" then? > > >> > > > > >> > > To really support packed virtqueue with vhost-vdpa, at that point we would > > >> > > also have to revert this patch. > > >> > > > > >> > > I wasn't sure if you wanted to queue the series for this merge window. > > >> > > In that case do you think it is better to send this patch only for stable > > >> > > branches? > > >> > > > Does this patch make them a NOP? > > >> > > > > >> > > Yep, after applying the "better PACKED support" series and being > > >> > > sure that > > >> > > the IOCTLs of vhost-vdpa support packed virtqueue, we should revert this > > >> > > patch. > > >> > > > > >> > > Let me know if you prefer a different approach. > > >> > > > > >> > > I'm concerned that QEMU uses vhost-vdpa IOCTLs thinking that the kernel > > >> > > interprets them the right way, when it does not. > > >> > > > > >> > > Thanks, > > >> > > Stefano > > >> > > > > >> > > > >> > If this fixes a bug can you add Fixes tags to each of them? Then it's ok > > >> > to merge in this window. Probably easier than the elaborate > > >> > mask/unmask dance. > > >> > > >> CCing Shannon (the original author of the "better PACKED support" > > >> series). > > >> > > >> IIUC Shannon is going to send a v3 of that series to fix the > > >> documentation, so Shannon can you also add the Fixes tags? > > >> > > >> Thanks, > > >> Stefano > > > > > >Well this is in my tree already. Just reply with > > >Fixes: <> > > >to each and I will add these tags. > > > > I tried, but it is not easy since we added the support for packed > > virtqueue in vdpa and vhost incrementally. > > > > Initially I was thinking of adding the same tag used here: > > > > Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") > > > > Then I discovered that vq_state wasn't there, so I was thinking of > > > > Fixes: 530a5678bc00 ("vdpa: support packed virtqueue for set/get_vq_state()") > > > > So we would have to backport quite a few patches into the stable branches. > > I don't know if it's worth it... > > > > I still think it is better to disable packed in the stable branches, > > otherwise I have to make a list of all the patches we need. > > > > Any other ideas? > > AFAIK, except for vp_vdpa, pds seems to be the first parent that > supports packed virtqueue. Users should not notice anything wrong if > they don't use packed virtqueue. And the problem of vp_vdpa + packed > virtqueue came since the day0 of vp_vdpa. It seems fine to do nothing > I guess. > > Thanks I have a question though, what if down the road there is a new feature that needs more changes? It will be broken too just like PACKED no? Shouldn't vdpa have an allowlist of features it knows how to support? > > > > Thanks, > > Stefano > > > >