Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6427686rwd; Mon, 5 Jun 2023 18:40:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5XyR+d3qAA8AIn2IekhTZRztLwgpvDDShekwKQ7+x8dSgo3MQ6yqZ5KiGXbm9mok2zTck0 X-Received: by 2002:a05:620a:4fc:b0:75d:50bb:b176 with SMTP id b28-20020a05620a04fc00b0075d50bbb176mr556610qkh.11.1686015620650; Mon, 05 Jun 2023 18:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686015620; cv=none; d=google.com; s=arc-20160816; b=Ks/Tgbwk8rskj4Lwz/CJ4sP7jlweMyKkCWGgzykdfjHeN4gtTfoCAn5QvwsXxunryZ Vs8DtjZhT/kFxfPSSPq987aF601gnV2op5vyh7Z+ViX4u4zKeSr/38sAQ9gH4BDWHxq8 P/ibxH0oUp9Swc0dACgw1smVXsqRHHSA5o4T2cYfj3KQ59phkf66vecfeXiaBNG/if9N tYANOzIjlaKkc0TxfKv5yrOMqV2F63+sQ+dPJJkMTZx7HyfVX7P16MgHCHoo/6x1WvYL EY9cUJDXZ574YIPcOiu87RtbSwUQKXIO/Z4drd9WrTpr5utXoM0ox86LyFYM8iYlDni+ e7Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LO0PcoIQipRUJHYAP4IZqQY6Y4aLmW6KIu9FvB1onCA=; b=daDT2KuAm7QS6gkrqXW6OJHPMmFM3N6clVoxE3kCNh15RVmHlqB4BY1vGAaOfYNDJN lslVt7QrhVyGKqu+0xsD9VzZc6t/ryzyrlgBZKF/K2BgWV9F1UilfpPrAzYcOPHKRjz1 uk8UZsQHh0V98CNeEZM6OfBymLXZhphAnpG0O5r+06zlK9ArHmKwgmr2GlY1LpsiJiEv WHzxeWvyEoipzotZDR7sylpHWGqSjYVwbbfIgRCmmuUuA5cNOz/3lBGhdkbkuDVWD/ZB P1qNGfTHFrzbcI2EbYq52ZKH6cjmSMi5ifC7B+p0DvMpKktfl7RzgzhcQYWdc23Jt/yA oTuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="SbfCjf/B"; 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 cz51-20020a05620a36f300b0075c9b5d1ab6si5239758qkb.457.2023.06.05.18.40.06; Mon, 05 Jun 2023 18:40:20 -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="SbfCjf/B"; 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 S233315AbjFFBaV (ORCPT + 99 others); Mon, 5 Jun 2023 21:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjFFBaU (ORCPT ); Mon, 5 Jun 2023 21:30:20 -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 A846C102 for ; Mon, 5 Jun 2023 18:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686014976; 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=LO0PcoIQipRUJHYAP4IZqQY6Y4aLmW6KIu9FvB1onCA=; b=SbfCjf/BhLm68DtmdtVWQKGTfZA42ZougQdNGNd9m/YwUYw99VJNU5YUcY49loDexsa/Dj BqOHfLcDUE0MhkDNrfqfZbNdVrSyV5ndfX5EvmktT8Sa+UnGOccxItiMHxSZzPOkxT0UvU DFEQDDNH1fpInc/Q0sHEli96MF1PdUg= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-xkTozMKkPauVKtPk8QhExA-1; Mon, 05 Jun 2023 21:29:35 -0400 X-MC-Unique: xkTozMKkPauVKtPk8QhExA-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b1b1693338so26602341fa.3 for ; Mon, 05 Jun 2023 18:29:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686014974; x=1688606974; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LO0PcoIQipRUJHYAP4IZqQY6Y4aLmW6KIu9FvB1onCA=; b=iTLtKOSnaq+El51Ce469Vod+7MPF/KckIko/5PUQpYvpxQfrjL5p+j8JKUZNH9EnB/ csMqE1LT+8qvR46LRrTqukekQl3/DqYQH8acsPfd/4szWlJdBsY4NSlTSMqhDxi/DvhI e6HAdx6BhueEkP/2l+/ydN8QuqE4xpoW++1ZT9FTbNaAnfOz4EdjvjRH1LKC/l5YdRO7 lXdaCo0j5M3TGRnwJvZN8o3I8i2XiH546pczqN7Y6qevzdpWu/5dwhFBEBLdMvsBtOX6 PHmWRUhRXnnWYjuxpY8kFUNpgM/6I5z+4/E0bFn6gNStHGKuaQ5fWOFDYXpqqrRM5VeP 8M4A== X-Gm-Message-State: AC+VfDxthjvPHerjIxMK/ZtodiQN/X8NlIHGOyswFwafrFrqnlBos8ET ka0PebrFEf1x0OcLlXLJ2eJnqArpzzfMGeuUyhVfURKNBFEQD2oIXGUWSvTwif0nGSwTrnCyQXW vWTmOoEXKbkk3S11MXSBBMxmB5tiMQMX6sTxGn7G9 X-Received: by 2002:a05:651c:90:b0:2ac:770f:8831 with SMTP id 16-20020a05651c009000b002ac770f8831mr471625ljq.40.1686014974165; Mon, 05 Jun 2023 18:29:34 -0700 (PDT) X-Received: by 2002:a05:651c:90:b0:2ac:770f:8831 with SMTP id 16-20020a05651c009000b002ac770f8831mr471619ljq.40.1686014973831; Mon, 05 Jun 2023 18:29:33 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <32ejjuvhvcicv7wjuetkv34qtlpa657n4zlow4eq3fsi2twozk@iqnd2t5tw2an> From: Jason Wang Date: Tue, 6 Jun 2023 09:29:22 +0800 Message-ID: Subject: Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature To: Stefano Garzarella Cc: "Michael S. Tsirkin" , Shannon Nelson , virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, =?UTF-8?Q?Eugenio_P=C3=A9rez?= , Tiwei Bie , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 5, 2023 at 10:58=E2=80=AFPM 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 wro= te: > >> > > > > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_B= ASE) > >> > > > > don't support packed virtqueue well yet, so let's filter the > >> > > > > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_feature= s(). > >> > > > > > >> > > > > This way, even if the device supports it, we don't risk it bei= ng > >> > > > > negotiated, then the VMM is unable to set the vring state prop= erly. > >> > > > > > >> > > > > 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] vh= ost_vdpa: > >> > > > > better PACKED support" series [1] and backported in stable= branches. > >> > > > > > >> > > > > We can revert it when we are sure that everything is worki= ng 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 win= dow. > >> > > 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 rever= t this > >> > > patch. > >> > > > >> > > Let me know if you prefer a different approach. > >> > > > >> > > I'm concerned that QEMU uses vhost-vdpa IOCTLs thinking that the k= ernel > >> > > 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 > > Thanks, > Stefano > >