From patchwork Wed Mar 13 11:54:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonah Palmer X-Patchwork-Id: 13591348 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFEFBC54E58 for ; Wed, 13 Mar 2024 11:55:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkNCJ-0001zp-OH; Wed, 13 Mar 2024 07:55:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkNCG-0001xr-0n; Wed, 13 Mar 2024 07:55:00 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkNBz-0004WD-JA; Wed, 13 Mar 2024 07:54:59 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42D8huc7026177; Wed, 13 Mar 2024 11:54:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=x425CgQCm9IuNpTGSsVZd6PQEQeKNKoKzHdBNeiQBqc=; b=KfddV/AOMRw3ljK12R4ixYb4FjtK2GGjtDqw0CBJWxUk0l60vgdT42EmWOT1ozvnO1EI +L1GgCjrQLYa8l6nXYivt9U0hYkhygOlRShus/2JVRNcniR1XfCMh+Wuwj2FELPwRAGZ vgphsmniJMA3bXuEZxz9jieF29yZR7YoDWc3bNDHPtbDR40ZUx7MiRJOJ3xI8ldLV6xL fvVoKAFzYk5bK7T6xPrJm6oaJhUfP4pn66uN8zM0exDS4TXRlncojXE6tdmq7XCzmlql sCnODcc/rgT9tu82hu0ShIVuzASZE9KI4TT31+nTCCN5teF8RFP79jbzMMpxAfMp2SHL JQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrfcugtnd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2024 11:54:24 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42DAx8gE028547; Wed, 13 Mar 2024 11:54:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre78pegm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Mar 2024 11:54:23 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42DBsMLZ035677; Wed, 13 Mar 2024 11:54:22 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-201-251.vpn.oracle.com [10.39.201.251]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre78peed-1; Wed, 13 Mar 2024 11:54:22 +0000 From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, jasowang@redhat.com, eperezma@redhat.com, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, farman@linux.ibm.com, thuth@redhat.com, richard.henderson@linaro.org, david@redhat.com, iii@linux.ibm.com, cohuck@redhat.com, pbonzini@redhat.com, fam@euphon.net, stefanha@redhat.com, qemu-block@nongnu.org, qemu-s390x@nongnu.org, leiyang@redhat.com, schalla@marvell.com, vattunuru@marvell.com, jerinj@marvell.com, dtatulea@nvidia.com, virtio-fs@lists.linux.dev Subject: [PATCH v2 0/6] virtio,vhost: Add VIRTIO_F_NOTIFICATION_DATA support Date: Wed, 13 Mar 2024 07:54:06 -0400 Message-Id: <20240313115412.3334962-1-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-13_07,2024-03-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403130089 X-Proofpoint-ORIG-GUID: mmZDxwsr6SzFkLr4NHN-DhuXNwTyA1-4 X-Proofpoint-GUID: mmZDxwsr6SzFkLr4NHN-DhuXNwTyA1-4 Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The goal of these patches are to add support to a variety of virtio and vhost devices for the VIRTIO_F_NOTIFICATION_DATA transport feature. This feature indicates that a driver will pass extra data (instead of just a virtqueue's index) when notifying the corresponding device. The data passed in by the driver when this feature is enabled varies in format depending on if the device is using a split or packed virtqueue layout: Split VQ - Upper 16 bits: shadow_avail_idx - Lower 16 bits: virtqueue index Packed VQ - Upper 16 bits: 1-bit wrap counter & 15-bit shadow_avail_idx - Lower 16 bits: virtqueue index Also, due to the limitations of ioeventfd not being able to carry the extra provided by the driver, having both VIRTIO_F_NOTIFICATION_DATA feature and ioeventfd enabled is a functional mismatch. The user must explicitly disable ioeventfd for the device in the Qemu arguments when using this feature, else the device will fail to complete realization. For example, a device must explicitly enable notification_data as well as disable ioeventfd: -device virtio-scsi-pci,...,ioeventfd=off,notification_data=on A significant aspect of this effort has been to maintain compatibility across different backends. As such, the feature is offered by backend devices only when supported, with fallback mechanisms where backend support is absent. v2: Don't disable ioeventfd by default, user must disable it Drop tags on patch 2/6 Jonah Palmer (6): virtio/virtio-pci: Handle extra notification data virtio: Prevent creation of device using notification-data with ioeventfd virtio-mmio: Handle extra notification data virtio-ccw: Handle extra notification data vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits virtio: Add VIRTIO_F_NOTIFICATION_DATA property definition hw/block/vhost-user-blk.c | 1 + hw/net/vhost_net.c | 2 ++ hw/s390x/s390-virtio-ccw.c | 16 +++++++++++---- hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/virtio/vhost-user-fs.c | 2 +- hw/virtio/vhost-user-vsock.c | 1 + hw/virtio/virtio-mmio.c | 9 ++++++-- hw/virtio/virtio-pci.c | 10 ++++++--- hw/virtio/virtio.c | 40 ++++++++++++++++++++++++++++++++++++ include/hw/virtio/virtio.h | 7 ++++++- net/vhost-vdpa.c | 1 + 12 files changed, 80 insertions(+), 11 deletions(-)