Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2225850/?format=api
{ "id": 2225850, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2225850/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260421163438.3447280-13-clg@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.1/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260421163438.3447280-13-clg@redhat.com>", "date": "2026-04-21T16:34:36", "name": "[PULL,12/14] vfio-user: support VFIO_USER_DEVICE_FEATURE", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c02e5b09bc83817174056c5ac704be7aa4435f98", "submitter": { "id": 85406, "url": "http://patchwork.ozlabs.org/api/1.1/people/85406/?format=api", "name": "Cédric Le Goater", "email": "clg@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260421163438.3447280-13-clg@redhat.com/mbox/", "series": [ { "id": 500853, "url": "http://patchwork.ozlabs.org/api/1.1/series/500853/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500853", "date": "2026-04-21T16:34:24", "name": "[PULL,01/14] hw/vfio/listener.c: remove CONFIG_KVM", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500853/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225850/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225850/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=cr48ujhS;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0ShK39Vgz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 02:37:53 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wFE5E-00058q-Uo; Tue, 21 Apr 2026 12:36:23 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <clg@redhat.com>) id 1wFE4N-0004mJ-Aa\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 12:35:28 -0400", "from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <clg@redhat.com>) id 1wFE4B-0007Ra-KX\n for qemu-devel@nongnu.org; Tue, 21 Apr 2026 12:35:18 -0400", "from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-547-cvLt6BlhMzydZj7DCD-t6w-1; Tue,\n 21 Apr 2026 12:35:09 -0400", "from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id D81651956088; Tue, 21 Apr 2026 16:35:08 +0000 (UTC)", "from corto.redhat.com (unknown [10.44.32.70])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 67F731956095; Tue, 21 Apr 2026 16:35:07 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776789313;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=WyHtqI2Ue/MKNZUMYUPQJtTao0sjJcCWoBG4JpXT4Eo=;\n b=cr48ujhSyacv+ZcS8xOeirtD096/W2rfj6hio3VnyacH45u/80pl0agaSTm/WLY/+g7ZDb\n XZPzWMHyME3NHo/yycnTpoX2dx/FSCd3avZ6TqiSoT1uzMA384X0M71uTGjkfMMqDl24QZ\n dBDBZbxaoiqI/0go1HHc5a80L7hssjw=", "X-MC-Unique": "cvLt6BlhMzydZj7DCD-t6w-1", "X-Mimecast-MFC-AGG-ID": "cvLt6BlhMzydZj7DCD-t6w_1776789308", "From": "=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "Alex Williamson <alex@shazbot.org>, John Levon <john.levon@nutanix.com>,\n\t=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@redhat.com>", "Subject": "[PULL 12/14] vfio-user: support VFIO_USER_DEVICE_FEATURE", "Date": "Tue, 21 Apr 2026 18:34:36 +0200", "Message-ID": "<20260421163438.3447280-13-clg@redhat.com>", "In-Reply-To": "<20260421163438.3447280-1-clg@redhat.com>", "References": "<20260421163438.3447280-1-clg@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.17", "Received-SPF": "pass client-ip=170.10.129.124; envelope-from=clg@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: John Levon <john.levon@nutanix.com>\n\nPlumb through vfio_device_get_feature to the vfio-user server. Note that\nwe translate EINVAL into ENOTTY, as the existing generic vfio code is\nexpecting the latter to mean \"unsupported\".\n\nAs part of adding a trace point, clean up the trace file.\n\nSigned-off-by: John Levon <john.levon@nutanix.com>\nReviewed-by: Cédric Le Goater <clg@redhat.com>\nLink: https://lore.kernel.org/qemu-devel/20260410085716.877185-2-john.levon@nutanix.com\nSigned-off-by: Cédric Le Goater <clg@redhat.com>\n---\n hw/vfio-user/protocol.h | 12 +++++++++++\n hw/vfio-user/device.c | 42 +++++++++++++++++++++++++++++++++++++++\n hw/vfio-user/trace-events | 23 +++++++++++----------\n 3 files changed, 67 insertions(+), 10 deletions(-)", "diff": "diff --git a/hw/vfio-user/protocol.h b/hw/vfio-user/protocol.h\nindex 3249a4a6b62af95e3718ed5053bbf310cd08c024..2a0c31e7c57f8ed86681ebd96b20df3e32792dec 100644\n--- a/hw/vfio-user/protocol.h\n+++ b/hw/vfio-user/protocol.h\n@@ -40,6 +40,7 @@ enum vfio_user_command {\n VFIO_USER_DEVICE_RESET = 13,\n VFIO_USER_DIRTY_PAGES = 14,\n VFIO_USER_REGION_WRITE_MULTI = 15,\n+ VFIO_USER_DEVICE_FEATURE = 16,\n VFIO_USER_MAX,\n };\n \n@@ -239,4 +240,15 @@ typedef struct {\n VFIOUserWROne wrs[VFIO_USER_MULTI_MAX];\n } VFIOUserWRMulti;\n \n+/*\n+ * VFIO_USER_DEVICE_FEATURE\n+ * imported from struct vfio_device_feature\n+ */\n+typedef struct {\n+ VFIOUserHdr hdr;\n+ uint32_t argsz;\n+ uint32_t flags;\n+ char data[];\n+} VFIOUserDeviceFeature;\n+\n #endif /* VFIO_USER_PROTOCOL_H */\ndiff --git a/hw/vfio-user/device.c b/hw/vfio-user/device.c\nindex 64ef35b3209429f7158d4ea79f095a5f16950d77..b8d2b7c1a84bb1914a71fdccbbdff675373cef3b 100644\n--- a/hw/vfio-user/device.c\n+++ b/hw/vfio-user/device.c\n@@ -74,6 +74,47 @@ void vfio_user_device_reset(VFIOUserProxy *proxy)\n }\n }\n \n+static int\n+vfio_user_device_io_device_feature(VFIODevice *vbasedev,\n+ struct vfio_device_feature *feature)\n+{\n+ g_autofree VFIOUserDeviceFeature *msgp = NULL;\n+ int size = sizeof(VFIOUserHdr) + feature->argsz;\n+ VFIOUserProxy *proxy = vbasedev->proxy;\n+ Error *local_err = NULL;\n+\n+ msgp = g_malloc0(size);\n+\n+ vfio_user_request_msg(&msgp->hdr, VFIO_USER_DEVICE_FEATURE, size, 0);\n+\n+ memcpy(&msgp->argsz, &feature->argsz, feature->argsz);\n+\n+ if (!vfio_user_send_wait(proxy, &msgp->hdr, NULL, size, &local_err)) {\n+ error_prepend(&local_err, \"%s: \", __func__);\n+ error_report_err(local_err);\n+ return -EFAULT;\n+ }\n+\n+ if (msgp->hdr.flags & VFIO_USER_ERROR) {\n+ /*\n+ * Client expects ENOTTY for \"not supported\", but the protocol may\n+ * return EINVAL (which should only occur in the case the feature isn't\n+ * actually supported on the server).\n+ */\n+ if (msgp->hdr.error_reply == EINVAL) {\n+ return -ENOTTY;\n+ }\n+\n+ return -msgp->hdr.error_reply;\n+ }\n+\n+ memcpy(feature, &msgp->argsz, feature->argsz);\n+\n+ trace_vfio_user_device_io_device_feature(msgp->argsz, msgp->flags);\n+\n+ return 0;\n+}\n+\n static int vfio_user_get_region_info(VFIOUserProxy *proxy,\n struct vfio_region_info *info,\n VFIOUserFDs *fds)\n@@ -432,6 +473,7 @@ static int vfio_user_device_io_region_write(VFIODevice *vbasedev, uint8_t index,\n * Socket-based io_ops\n */\n VFIODeviceIOOps vfio_user_device_io_ops_sock = {\n+ .device_feature = vfio_user_device_io_device_feature,\n .get_region_info = vfio_user_device_io_get_region_info,\n .get_irq_info = vfio_user_device_io_get_irq_info,\n .set_irqs = vfio_user_device_io_set_irqs,\ndiff --git a/hw/vfio-user/trace-events b/hw/vfio-user/trace-events\nindex abb67f4c119af533a77ad04e383fa027e5aaa684..503e1c82d43a7d9361b1e5d487929ecc5a8a83da 100644\n--- a/hw/vfio-user/trace-events\n+++ b/hw/vfio-user/trace-events\n@@ -2,19 +2,22 @@\n #\n # SPDX-License-Identifier: GPL-2.0-or-later\n \n-# common.c\n+# container.c\n+vfio_user_dma_map(uint64_t iova, uint64_t size, uint64_t off, uint32_t flags, bool async_ops) \" iova 0x%\"PRIx64\" size 0x%\"PRIx64\" off 0x%\"PRIx64\" flags 0x%x async_ops %d\"\n+vfio_user_dma_unmap(uint64_t iova, uint64_t size, uint32_t flags, bool async_ops) \" iova 0x%\"PRIx64\" size 0x%\"PRIx64\" flags 0x%x async_ops %d\"\n+\n+# device.c\n+vfio_user_device_io_device_feature(uint32_t argsz, uint32_t flags) \" argsz 0x%x flags 0x%x\"\n+vfio_user_get_info(uint32_t nregions, uint32_t nirqs) \" #regions %d #irqs %d\"\n+vfio_user_get_irq_info(uint32_t index, uint32_t flags, uint32_t count) \" index %d flags 0x%x count %d\"\n+vfio_user_set_irqs(uint32_t index, uint32_t start, uint32_t count, uint32_t flags) \" index %d start %d count %d flags 0x%x\"\n+vfio_user_get_region_info(uint32_t index, uint32_t flags, uint64_t size) \" index %d flags 0x%x size 0x%\"PRIx64\n+vfio_user_region_rw(uint32_t region, uint64_t off, uint32_t count) \" region %d offset 0x%\"PRIx64\" count %d\"\n+\n+# proxy.c\n vfio_user_recv_hdr(const char *name, uint16_t id, uint16_t cmd, uint32_t size, uint32_t flags) \" (%s) id 0x%x cmd 0x%x size 0x%x flags 0x%x\"\n vfio_user_recv_read(uint16_t id, int read) \" id 0x%x read 0x%x\"\n vfio_user_recv_request(uint16_t cmd) \" command 0x%x\"\n vfio_user_send_write(uint16_t id, int wrote) \" id 0x%x wrote 0x%x\"\n vfio_user_version(uint16_t major, uint16_t minor, const char *caps) \" major %d minor %d caps: %s\"\n-vfio_user_get_info(uint32_t nregions, uint32_t nirqs) \" #regions %d #irqs %d\"\n-vfio_user_get_region_info(uint32_t index, uint32_t flags, uint64_t size) \" index %d flags 0x%x size 0x%\"PRIx64\n-vfio_user_region_rw(uint32_t region, uint64_t off, uint32_t count) \" region %d offset 0x%\"PRIx64\" count %d\"\n-vfio_user_get_irq_info(uint32_t index, uint32_t flags, uint32_t count) \" index %d flags 0x%x count %d\"\n-vfio_user_set_irqs(uint32_t index, uint32_t start, uint32_t count, uint32_t flags) \" index %d start %d count %d flags 0x%x\"\n vfio_user_wrmulti(const char *s, uint64_t wr_cnt) \" %s count 0x%\"PRIx64\n-\n-# container.c\n-vfio_user_dma_map(uint64_t iova, uint64_t size, uint64_t off, uint32_t flags, bool async_ops) \" iova 0x%\"PRIx64\" size 0x%\"PRIx64\" off 0x%\"PRIx64\" flags 0x%x async_ops %d\"\n-vfio_user_dma_unmap(uint64_t iova, uint64_t size, uint32_t flags, bool async_ops) \" iova 0x%\"PRIx64\" size 0x%\"PRIx64\" flags 0x%x async_ops %d\"\n", "prefixes": [ "PULL", "12/14" ] }