Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp330339rdb; Tue, 19 Dec 2023 19:50:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeYUfMw4iwvGPAe75MErYVV9/fIHCDhUUX4h7M3RrrCHEZt1VYiTeoKVd0vUjuXSvT+xVb X-Received: by 2002:a05:6e02:1bc6:b0:35d:59a2:bb1 with SMTP id x6-20020a056e021bc600b0035d59a20bb1mr18629666ilv.71.1703044247364; Tue, 19 Dec 2023 19:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703044247; cv=none; d=google.com; s=arc-20160816; b=aJfE534zlE0WkyQwRAToWTm1wuPZFR+SxwoZ7vydHASnxktu+lorbtPFNzRQ1XNRoF mGqK3xdqtPSXvdNaYcPZcg0JjmonBKXoKqcrtysp3gdF6EmSpVzeL94ZqKO2imro7Wdq bHCm1xlgBp4UJL6esZK1GrRhHz9rfqaQt9FbrFkDw0oSQnsYHCM9gaGz9A8eiOCrlal2 e80ogGZPViT8g/NUhYXj6i14jG8DijnT4/Z7R6GKXANZIu1cncyAVP5oc1Sv6XGrpeou NpiBN1P57KLL+aUqZvTlYHapuSmjfRUYegz8tI2ncMo/RWoMF1GAqXGL9fH1GXxpFxwj LyHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=S3W0GnoD8052wYxUNxx5sjwSUJEmm53y4MFQD1spj90=; fh=u5D3mNlx1QihZ2v19S3mCjq+9SJypsZebTw8/Qgwi8I=; b=FzrJVBmI44YzXgQTgE6jgaLcLQfxup6rYOoQ3yzGC2HS4spFU/Q9xw9Vv4mnKKwjoS RCvD9jmPn0sSnfxWiZKFa2J+s+WAwVuS3wRHxEcFR4d/4uYy7usV0X5iQ+p6ljVsApFH ZuJhuhMnASIxgAJe9E68+yTWWxlJKkrk8yeVvFOkbyFoXYehdo6quqrzF+PSty8SOOiG wtd3Hby6q0LBYz4cOGMGWkoophJWw4cGL5dX22sq5swpKi72DCltnh8pq+/DXC0f3Hhj kPDKvt+30KjKflo64FwASEryu283ZOBB9QFuh5JBqF0/Zwy2mqagTsDCtDxP4HgD3zjO cxQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d2A2m2V4; spf=pass (google.com: domain of linux-kernel+bounces-6336-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a5-20020a056a000c8500b006d5f9a95c85si5609128pfv.371.2023.12.19.19.50.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 19:50:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6336-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d2A2m2V4; spf=pass (google.com: domain of linux-kernel+bounces-6336-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 69E99285738 for ; Wed, 20 Dec 2023 03:50:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D0C9BE68; Wed, 20 Dec 2023 03:50:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d2A2m2V4" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9B63FBE0 for ; Wed, 20 Dec 2023 03:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703044234; 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=S3W0GnoD8052wYxUNxx5sjwSUJEmm53y4MFQD1spj90=; b=d2A2m2V4xaNZAtN0CwpvIYk2M9uzVip9Rafu+kI1aFLrBo7JeJCpkkxv5jvHktVU4kBqPB YBasgGw25NY8UZ7PUj1PMVhkgbKEwCnxh0EdiVojZuicy5xsHkic1GCNhtDRosyJ9qD3d2 XfXnAsXScxF2tGXxdi/jH1f/kaC0PF8= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-569-3OEiaaglOYaCIrfQYxUWLA-1; Tue, 19 Dec 2023 22:50:32 -0500 X-MC-Unique: 3OEiaaglOYaCIrfQYxUWLA-1 Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-5c668dc7f7bso4718768a12.3 for ; Tue, 19 Dec 2023 19:50:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703044232; x=1703649032; 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=S3W0GnoD8052wYxUNxx5sjwSUJEmm53y4MFQD1spj90=; b=PzIPoG2gfCHW1kGcS0SHP65EVrz+s+5s6HO5uxzAzjgKEKO0esjWTFhO0LmQTtD3Rc nDrQz4uKkmlXAR1uZLOE2YmkIgjYBhdIIAN0SGFhUoYLN7rzQA/9dnYWh0DbmiIr84aO I925txE0UBfiMOnj4eQvrgZ4n/73fcDRNp6LbL8QDbAVgOu4yfZ8jhcTU93CZP7lU2eW HCDsfQ8Veri4Sa7GJyKSaE48y0EqBIXrurKZlbDzUZkNWqr1tpaKgWpqt+IxJjBp3CO/ ZcgNcmHGDwrwUPVvfH2QXuHTfhZSU9V8wW4J1iTjY570+sU87KArEKJKSBKCrLfNszLV 9udQ== X-Gm-Message-State: AOJu0YwIP8magaU/Tovcv1MU8Jwmy3yiATfBw0AMs6pBgMhYnEO2akk/ 2YffbOD/nAjvzDyaseQqtdEPMf0+1M00t8nH1lzuYVAwKeKwL7DdlbhV+nQZCSu7SmKLwo2zELD OBKatps+qqvhMFXSIv3NcqQqFyUSmvYGE93dwTXOx X-Received: by 2002:a05:6a20:3942:b0:18f:97c:6163 with SMTP id r2-20020a056a20394200b0018f097c6163mr25126882pzg.96.1703044231869; Tue, 19 Dec 2023 19:50:31 -0800 (PST) X-Received: by 2002:a05:6a20:3942:b0:18f:97c:6163 with SMTP id r2-20020a056a20394200b0018f097c6163mr25126875pzg.96.1703044231593; Tue, 19 Dec 2023 19:50:31 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231212131712.1816324-1-maxime.coquelin@redhat.com> <20231212131712.1816324-3-maxime.coquelin@redhat.com> <8afc44f7-cef5-4b4a-afac-85a4eb967d3e@redhat.com> In-Reply-To: From: Jason Wang Date: Wed, 20 Dec 2023 11:50:20 +0800 Message-ID: Subject: Re: [PATCH v5 2/4] vduse: Temporarily disable control queue features To: Maxime Coquelin Cc: mst@redhat.com, xuanzhuo@linux.alibaba.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, xieyongji@bytedance.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, david.marchand@redhat.com, lulu@redhat.com, casey@schaufler-ca.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 18, 2023 at 5:21=E2=80=AFPM Maxime Coquelin wrote: > > > > On 12/18/23 03:50, Jason Wang wrote: > > On Wed, Dec 13, 2023 at 7:23=E2=80=AFPM Maxime Coquelin > > wrote: > >> > >> Hi Jason, > >> > >> On 12/13/23 05:52, Jason Wang wrote: > >>> On Tue, Dec 12, 2023 at 9:17=E2=80=AFPM Maxime Coquelin > >>> wrote: > >>>> > >>>> Virtio-net driver control queue implementation is not safe > >>>> when used with VDUSE. If the VDUSE application does not > >>>> reply to control queue messages, it currently ends up > >>>> hanging the kernel thread sending this command. > >>>> > >>>> Some work is on-going to make the control queue > >>>> implementation robust with VDUSE. Until it is completed, > >>>> let's disable control virtqueue and features that depend on > >>>> it. > >>>> > >>>> Signed-off-by: Maxime Coquelin > >>> > >>> I wonder if it's better to fail instead of a mask as a start. > >> > >> I think it is better to use a mask and not fail, so that we can in the > >> future use a recent VDUSE application with an older kernel. > > > > It may confuse the userspace unless userspace can do post check after > > CREATE_DEV. > > > > And for blk we fail when WCE is set in feature_is_valid(): > > > > static bool features_is_valid(u64 features) > > { > > if (!(features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) > > return false; > > > > /* Now we only support read-only configuration space */ > > if (features & (1ULL << VIRTIO_BLK_F_CONFIG_WCE)) > > return false; > > > > return true; > > } > > Ok, consistency with other devices types is indeed better. > > But should I fail if any of the feature advertised by the application is > not listed by the VDUSE driver, or just fail if control queue is being > advertised by the application? Maybe it's better to fail for any other of the features that depend on the control vq. Thanks > > Thanks, > Maxime > > > Thanks > > > >> > >> Why would it be better to fail than negotiating? > >> > >> Thanks, > >> Maxime > >> > > >