Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6900145rwd; Tue, 6 Jun 2023 03:43:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4I4tfDYEpmIlmosy73OzhGeEGgsbtTZOpf5Iqzn1h3G2XXUhDFOj6F7Mt5BXt4wHanJQf3 X-Received: by 2002:ad4:5cc4:0:b0:625:aa49:19eb with SMTP id iu4-20020ad45cc4000000b00625aa4919ebmr2112902qvb.56.1686048225517; Tue, 06 Jun 2023 03:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686048225; cv=none; d=google.com; s=arc-20160816; b=RbQSu9HTuAlncLDlBUrmOp9FbyR2KUy1cjX9VoiIp3lNzr2naRhpBXjUp3tBwoLc+8 fC1iqaG84IqPnVB5Nbuf8Sum8L0V2eF4AKH1AI+6hG9/i3fWmET6sfUYwUWtFu028ufi 4iYKU/EAUZ+NzyGWRnjnTBr77cSQlDwd6mbGHKPim2fPKbq+FfIgYRDmfnuBsqPgZrOR 5k/CVFbK+AkcJUQBEwwzYAZbb7B1PKOsu980YqsIuxA4811D7ElPKt/Un3+wBnaUKXvE 56U8xnSrpHEtEMr03qzaNZqjJu6nVI+rZpW3194H0M/pgjznE+hyRHwmYH4U25FW90MI k/6w== 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=iCQQ1LZ3gBqjk1nNTdvMqD1fo9eGMxkBs1BPtbczoAU=; b=ZztuN1kvgyfJRhjUt4ceq3oS3L9d9A5j+pjgOfVDP1Wsn+2hu5sXpRA8k4jEPQ8X5r PGgPFX42d0IvSD0pXiF1XQ72a1cn9e5rGSXq2d4MlWFvemsRxpMDkqkeGNgVzoemWJI3 KTDao689FIUbXLiaqoIjvktE36ziZE4/EhsfleM52BB/xU/rlyDdbu33rLGhLHsNe39K zALBvbX4AqcM/Iv5s1ORyaYhDyiXb+GOYgl/RnO9XAxYq3zRx5JYfPCigmMPKoBejfDe kGFB0NYDN6r26n8uXZYtRB3dznvV0Of20yeTmiU2nklGG0Wl/DGKjIuMoAshJUySHT86 MLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CMzI+gQA; 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 3-20020a0562140cc300b005e63b4566c5si6398363qvx.81.2023.06.06.03.43.31; Tue, 06 Jun 2023 03:43:45 -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=CMzI+gQA; 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 S236156AbjFFKKQ (ORCPT + 99 others); Tue, 6 Jun 2023 06:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237197AbjFFKKE (ORCPT ); Tue, 6 Jun 2023 06:10:04 -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 17A0FE42 for ; Tue, 6 Jun 2023 03:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686046158; 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=iCQQ1LZ3gBqjk1nNTdvMqD1fo9eGMxkBs1BPtbczoAU=; b=CMzI+gQAyItCHDIMjj9NsirIK23I57OXEt5I0alg3zLUGAoLX9v78ZP6SkzKq5m6gqW32P nVZLIBeyJOF2mpfuKxgN2PFQQnDYixMr6H2Utzr8ER5wglpS9UlDHiYqkdmXQN6tx3qnVc bu/I08NvQlmXr1uOq0uvChWDQEmfpuE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-z-lEInIYMhGv98882hjmrw-1; Tue, 06 Jun 2023 06:09:17 -0400 X-MC-Unique: z-lEInIYMhGv98882hjmrw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f7eb415010so2008635e9.0 for ; Tue, 06 Jun 2023 03:09:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686046156; x=1688638156; 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=iCQQ1LZ3gBqjk1nNTdvMqD1fo9eGMxkBs1BPtbczoAU=; b=Mu1LrGvEvtcSizxbGmBW3TtedDXin4+e/8XSlAhUHNf75gEUAvBuESbMfijnIlZRQT HELGFRbj4+ScLP6+hArXPS7LbUuAzcaVEsK80Qjv1KsazMQgfV6kNC4XQPaSfuL2KF1u ltQlQ4RyNEJs6Uw/sZumoQUU2032156HckE/82T1ZMq/oBUxmP0961LFMIE2gt7KUen9 nVvfZZHJE2Vj3xKPv8T4Ss24uyXzz0APjs2ZdbyZPJI6pwN5v2B0lN9RVWF3gxZtGhdn TlHNmH5f2eNk2e1cOzGZZB4TogKwovABiWyRRmb5f71pl2oF7KRjkPDCUgIGaJJz7qx+ HMgg== X-Gm-Message-State: AC+VfDweDguX0I7ROI3Uf9yaf5Gfo41virUEuzQolg6HtBrK6a+IqQj2 fn70B7HyvfHblJkQhPgUsZwLobb7OHbn9/GsEbdHy+MK/4lm6uv0BhU6h5EPzp3/PDkE92FxVrK fsQZoFvRaUT8VejEdon4NQLYT X-Received: by 2002:a05:600c:3797:b0:3f7:9b05:928e with SMTP id o23-20020a05600c379700b003f79b05928emr1391399wmr.0.1686046156247; Tue, 06 Jun 2023 03:09:16 -0700 (PDT) X-Received: by 2002:a05:600c:3797:b0:3f7:9b05:928e with SMTP id o23-20020a05600c379700b003f79b05928emr1391380wmr.0.1686046155959; Tue, 06 Jun 2023 03:09:15 -0700 (PDT) Received: from sgarzare-redhat (93-44-29-47.ip95.fastwebnet.it. [93.44.29.47]) by smtp.gmail.com with ESMTPSA id f4-20020adff8c4000000b00307a83ea722sm12052625wrq.58.2023.06.06.03.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 03:09:15 -0700 (PDT) Date: Tue, 6 Jun 2023 12:09:11 +0200 From: Stefano Garzarella To: "Michael S. Tsirkin" Cc: Shannon Nelson , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Jason Wang , 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> <20230605173958-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230605173958-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=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 Mon, Jun 05, 2023 at 05:44:50PM -0400, Michael S. Tsirkin wrote: >On Mon, Jun 05, 2023 at 04:56:37PM +0200, 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? >> >> Thanks, >> Stefano > >OK so. You want me to apply this one now, and fixes in the next >kernel? Yep, it seems to me the least risky approach. Thanks, Stefano