Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp432290rwd; Wed, 7 Jun 2023 01:50:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TCQC2UAoLWwEOHEAou3JC9rhQ+nJPS2n94UP1EMPfVtzCN81s3RJmQvQs0s3PqE2c9JDP X-Received: by 2002:a9d:745a:0:b0:6b0:73fe:cf10 with SMTP id p26-20020a9d745a000000b006b073fecf10mr5183704otk.5.1686127834481; Wed, 07 Jun 2023 01:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686127834; cv=none; d=google.com; s=arc-20160816; b=X024UXBVC/Y50RHKQMBZ/LQR5tIr3YJw1wuK0QjKMQCSJFguWtXA+BBvC++x7QH6K/ cN7T8Omyx0LvOLSgyt9rBzBKF7gQkfOoYULtJvaqhhzqTFLJ7aM3XXuB5NU6sXQXjDiv XteJmoQ0eTC7C0VUU56BfrZxTEWD9qSHl7M36Im1C4FFmS+6a44uf1+sNTQiJ27bBYAx z2tjN0tyKO0qtOUwaBD4ZIEKXDEJKuygoALVZA4zLBhGkfE1tpFvjs3KOmBWGYWi4t0I gTHTbtmLV7fT0GzeI5Xf5IJfhDTZIpg8EIbNh+ZIsiEbqAyVlQY2KiFhpfyo08tpjm84 rfWw== 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=ljArIlCjiAk4raJisPzBpvdPPgGsnUJvYTJw2BtF6ok=; b=LkQZbVU3z3a30wCCoSw42b68SIC/dCsKIZC1X5ksW4s/MyR8qFtLU5UGKfga4Qv4+L BQ+sFvi91L+aGtGQCglQ1RUymIuC2sB02NnZcFdrMDG9mT8Aldzd3k48S2qAxnSi09I2 +Ya9+K0fKkdl8ZEouJkC91mRBpAU0Cr0JXnKyIIIGNk4X4ECzK6jsQKjsMy1qIedgiyB osq/6vewgbuhK+0XkzgYYOqyME3zK4KevLehgwmGRkLKlP43wK2q3oMMFzi5oKCQ3oFx Vn/Iwjv/H+3Pyx+iwj0J3kto0iBoRWr4zax9NCgPTdguoH6e0SNJANI0IYwsfJNrfgOP XrUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S8zpOmU5; 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 i188-20020a6254c5000000b006434e20d023si8301114pfb.399.2023.06.07.01.50.22; Wed, 07 Jun 2023 01:50:34 -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=S8zpOmU5; 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 S238411AbjFGIkL (ORCPT + 99 others); Wed, 7 Jun 2023 04:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237989AbjFGIkJ (ORCPT ); Wed, 7 Jun 2023 04:40:09 -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 B6FD61707 for ; Wed, 7 Jun 2023 01:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686127162; 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=ljArIlCjiAk4raJisPzBpvdPPgGsnUJvYTJw2BtF6ok=; b=S8zpOmU5De/a4E3TJ8+4huENyU0kYf8OOjGD/n31Z+XeMgAyExHdt6I2alhXbf0vqVTaIn PKW+9Tx/UrAoiROWPOYjPPvQvIEHGFxvYswwWVsWO9/oo6M27ZyD4oCXTctjaBeaIYb3Xn 7DPmyIVQHVaNKU6nOpKa80meN/MPV18= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-M1_BAb_XPPKg1PFerbjBpw-1; Wed, 07 Jun 2023 04:39:20 -0400 X-MC-Unique: M1_BAb_XPPKg1PFerbjBpw-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-94a348facbbso630065966b.1 for ; Wed, 07 Jun 2023 01:39:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686127159; x=1688719159; 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=ljArIlCjiAk4raJisPzBpvdPPgGsnUJvYTJw2BtF6ok=; b=Zabf1dNdewMmAWbHknP7455aLpEbuVES/y8Tg1k9oGuCMDE0bCgtHj4vF58yS/Z00K ISQtrEI+mVGAJJYDz08p7TgTRH5tZ7AdojNCrMW1o5vJ69Lkmo5qNNDU3tgX/FNG4Xi2 VsUm2vKjf68YyUmWNEHan9WXzjPHVY6ONYSCuM7Yp/7TJ79xEwiveVHwmkPNeDq+zamG uuyC0yuOG2YmYoNdPAjjxXQhZFa9JqRUV0Ig0CSTvZ//JqwA3hg4wqWbRthxk5Zuof8l fTLAWX9hhhT/mnv7v9fD5NnvgkoXYlH/C0umxE+VJj+7pzA7c1Cn6g8hYgB+d6U9t2Yz GMFg== X-Gm-Message-State: AC+VfDxgRgZjgNAHLZ5eyLtwduCJfoQqMeyilF56ytn8fsd7CZ3B87Qi ohtbBQ3zZhx1aGbVagMmeL+cIFK8LG/RM4sK5Sl+4u8/QaJVxbVccCI3EbyGMmSX7SKBiGZ6Dtj mMqavioq6xT1nHnp//Jq4SSRm X-Received: by 2002:a17:907:2d91:b0:8b1:7de3:cfaa with SMTP id gt17-20020a1709072d9100b008b17de3cfaamr5662274ejc.3.1686127159116; Wed, 07 Jun 2023 01:39:19 -0700 (PDT) X-Received: by 2002:a17:907:2d91:b0:8b1:7de3:cfaa with SMTP id gt17-20020a1709072d9100b008b17de3cfaamr5662257ejc.3.1686127158820; Wed, 07 Jun 2023 01:39:18 -0700 (PDT) Received: from sgarzare-redhat (host-87-12-25-16.business.telecomitalia.it. [87.12.25.16]) by smtp.gmail.com with ESMTPSA id t15-20020a1709066bcf00b0096f7500502csm6655804ejs.199.2023.06.07.01.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 01:39:17 -0700 (PDT) Date: Wed, 7 Jun 2023 10:39:15 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: Jason Wang , Shannon Nelson , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Eugenio =?utf-8?B?UMOpcmV6?= , Tiwei Bie , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature Message-ID: 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> <20230606085643-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230606085643-mutt-send-email-mst@kernel.org> 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=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 Tue, Jun 6, 2023 at 2:58 PM Michael S. Tsirkin wrote: > > 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? It looks like we had it, but we took it out (by the way, we were enabling packed even though we didn't support it): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6234f80574d7569444d8718355fa2838e92b158b The only problem I see is that for each new feature we have to modify the kernel. Could we have new features that don't require handling by vhost-vdpa? Thanks, Stefano