Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74C2FC6FD1D for ; Tue, 21 Mar 2023 13:11:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229657AbjCUNLU (ORCPT ); Tue, 21 Mar 2023 09:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjCUNLR (ORCPT ); Tue, 21 Mar 2023 09:11:17 -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 522CE7D9A for ; Tue, 21 Mar 2023 06:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679404232; 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=LHioC2Bz+LhXLt/kWCD/RKd45AYTVWaKEiEQ85K6IJk=; b=OonW6Cc9063rdbAGGl5ZKuI+iUd9fVbKhwTNVP1RMncMX79xsU+GSjntgtm4XqnUTq5qlW Li9XdJiwF/Y9rm914qxe+JwRdln42nKt57F2E72UpYo+EhXo3wpKD+pT83FQKeUwFtaTly kucZQyJuyNT5UCHzOgH1OHmXS/bMTqo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-gQg3QGrOOUS7pjercg99cw-1; Tue, 21 Mar 2023 09:10:26 -0400 X-MC-Unique: gQg3QGrOOUS7pjercg99cw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC75A96DC85; Tue, 21 Mar 2023 13:10:25 +0000 (UTC) Received: from localhost (unknown [10.39.193.206]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56696140E95F; Tue, 21 Mar 2023 13:10:25 +0000 (UTC) From: Cornelia Huck To: "Michael S. Tsirkin" , Viktor Prutyanov Cc: Jason Wang , pasic@linux.ibm.com, farman@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, yan@daynix.com Subject: Re: [PATCH v2] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support In-Reply-To: <20230321050719-mutt-send-email-mst@kernel.org> Organization: Red Hat GmbH References: <20230320232115.1940587-1-viktor@daynix.com> <20230321050719-mutt-send-email-mst@kernel.org> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Tue, 21 Mar 2023 14:10:23 +0100 Message-ID: <87jzzamerk.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 21 2023, "Michael S. Tsirkin" wrote: > On Tue, Mar 21, 2023 at 12:00:42PM +0300, Viktor Prutyanov wrote: >> On Tue, Mar 21, 2023 at 5:29=E2=80=AFAM Jason Wang = wrote: >> > >> > On Tue, Mar 21, 2023 at 7:21=E2=80=AFAM Viktor Prutyanov wrote: >> > > >> > > According to VirtIO spec v1.2, VIRTIO_F_NOTIFICATION_DATA feature >> > > indicates that the driver passes extra data along with the queue >> > > notifications. >> > > >> > > In a split queue case, the extra data is 16-bit available index. In a >> > > packed queue case, the extra data is 1-bit wrap counter and 15-bit >> > > available index. >> > > >> > > Add support for this feature for MMIO and PCI transports. Channel I/O >> > > transport will not accept this feature. >> > > >> > > Signed-off-by: Viktor Prutyanov >> > > --- >> > > >> > > v2: reject the feature in virtio_ccw, replace __le32 with u32 >> > > >> > > drivers/s390/virtio/virtio_ccw.c | 4 +--- >> > > drivers/virtio/virtio_mmio.c | 15 ++++++++++++++- >> > > drivers/virtio/virtio_pci_common.c | 10 ++++++++++ >> > > drivers/virtio/virtio_pci_common.h | 4 ++++ >> > > drivers/virtio/virtio_pci_legacy.c | 2 +- >> > > drivers/virtio/virtio_pci_modern.c | 2 +- >> > > drivers/virtio/virtio_ring.c | 17 +++++++++++++++++ >> > > include/linux/virtio_ring.h | 2 ++ >> > > include/uapi/linux/virtio_config.h | 6 ++++++ >> > > 9 files changed, 56 insertions(+), 6 deletions(-) >> > > >> > > diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/= virtio_ccw.c >> > > index a10dbe632ef9..d72a59415527 100644 >> > > --- a/drivers/s390/virtio/virtio_ccw.c >> > > +++ b/drivers/s390/virtio/virtio_ccw.c >> > > @@ -789,9 +789,7 @@ static u64 virtio_ccw_get_features(struct virtio= _device *vdev) >> > > >> > > static void ccw_transport_features(struct virtio_device *vdev) >> > > { >> > > - /* >> > > - * Currently nothing to do here. >> > > - */ >> > > + __virtio_clear_bit(vdev, VIRTIO_F_NOTIFICATION_DATA); >> > >> > Is there any restriction that prevents us from implementing >> > VIRTIO_F_NOTIFICATION_DATA? (Spec seems doesn't limit us from this) >>=20 >> Most likely, nothing. > > So pls code it up. It's the same format. FWIW, the notification data needs to go via the third parameter of kvm_hypercall3() in virtio_ccw_kvm_notify().