get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2194493/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2194493,
    "url": "http://patchwork.ozlabs.org/api/patches/2194493/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260209073908.2125178-6-vsementsov@yandex-team.ru/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260209073908.2125178-6-vsementsov@yandex-team.ru>",
    "list_archive_url": null,
    "date": "2026-02-09T07:39:02",
    "name": "[05/10] vhost: simplify vhost_memory_map() and vhost_memory_unmap()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b6ac98014d92c61bacec27a89abf3733c2f2a479",
    "submitter": {
        "id": 84116,
        "url": "http://patchwork.ozlabs.org/api/people/84116/?format=api",
        "name": "Vladimir Sementsov-Ogievskiy",
        "email": "vsementsov@yandex-team.ru"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260209073908.2125178-6-vsementsov@yandex-team.ru/mbox/",
    "series": [
        {
            "id": 491471,
            "url": "http://patchwork.ozlabs.org/api/series/491471/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491471",
            "date": "2026-02-09T07:38:57",
            "name": "vhost-user: VHOST_USER_PROTOCOL_F_GPA_ADDRESSES",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491471/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2194493/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2194493/checks/",
    "tags": {},
    "related": [],
    "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=yandex-team.ru header.i=@yandex-team.ru\n header.a=rsa-sha256 header.s=default header.b=aHekf/N6;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
            "mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net;\n dkim=pass header.i=@yandex-team.ru"
        ],
        "Received": [
            "from lists.gnu.org (lists.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 4f8c765lvmz1xtr\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 09 Feb 2026 18:40:34 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vpLrw-0000sE-3j; Mon, 09 Feb 2026 02:39:40 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vpLrh-0000nC-03\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 02:39:27 -0500",
            "from forwardcorp1d.mail.yandex.net ([178.154.239.200])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vpLrb-0004fr-CF\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 02:39:23 -0500",
            "from mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net\n (mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net\n [IPv6:2a02:6b8:c42:65a0:0:640:e1de:0])\n by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id 8EFFE8075C;\n Mon, 09 Feb 2026 10:39:16 +0300 (MSK)",
            "from vsementsov-lin (unknown [2a02:6bf:8080:129::1:13])\n by mail-nwsmtp-smtp-corp-main-56.klg.yp-c.yandex.net (smtpcorp/Yandex) with\n ESMTPSA id BdLXu72As8c0-JVa7ECh8; Mon, 09 Feb 2026 10:39:16 +0300"
        ],
        "X-Yandex-Fwd": "1",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;\n s=default; t=1770622756;\n bh=JlAJLkQC4B4lhoBsNiiPpRV8n1pj6jtvYJYARvM3Cks=;\n h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From;\n b=aHekf/N6aM015VX2VRQTQkIz0epmU5lJAH3NMbMG8+QQeNdTtst5Gp+QKmxCiD4Z2\n hNCNTIpLXxsgvpre8Pwq3fth+Et/MDPKcM2Z+aUg5OP0C7KFLV9DoB/eHIxLd0MU/X\n W1qdQDSKKE20YiANPlgz8Vl8lLN6oq+grReS4Nbg=",
        "From": "Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>",
        "To": "mst@redhat.com",
        "Cc": "sgarzare@redhat.com, qemu-devel@nongnu.org, vsementsov@yandex-team.ru,\n d-tatianin@yandex-team.ru",
        "Subject": "[PATCH 05/10] vhost: simplify vhost_memory_map() and\n vhost_memory_unmap()",
        "Date": "Mon,  9 Feb 2026 10:39:02 +0300",
        "Message-ID": "<20260209073908.2125178-6-vsementsov@yandex-team.ru>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260209073908.2125178-1-vsementsov@yandex-team.ru>",
        "References": "<20260209073908.2125178-1-vsementsov@yandex-team.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=178.154.239.200;\n envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1d.mail.yandex.net",
        "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, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=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": "Make these functions simple wrappers around address_space_map() and\naddress_space_unmap(). Move IOMMU handling logic one layer up to the\ncallers.\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\n---\n hw/virtio/vhost.c | 43 ++++++++++++++++++++++++-------------------\n 1 file changed, 24 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c\nindex 587f301832..b43525da87 100644\n--- a/hw/virtio/vhost.c\n+++ b/hw/virtio/vhost.c\n@@ -456,21 +456,17 @@ static inline void vhost_dev_log_resize(struct vhost_dev *dev, uint64_t size)\n static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr,\n                               hwaddr len, bool is_write)\n {\n-    if (!vhost_dev_has_iommu(dev)) {\n-        hwaddr mapped_len = len;\n-        void *res = address_space_map(dev->vdev->dma_as, addr, &mapped_len,\n-                                      is_write, MEMTXATTRS_UNSPECIFIED);\n-        if (!res) {\n-            return NULL;\n-        }\n-        if (len != mapped_len) {\n-            address_space_unmap(dev->vdev->dma_as, res, mapped_len, 0, 0);\n-            return NULL;\n-        }\n-        return res;\n-    } else {\n-        return (void *)(uintptr_t)addr;\n+    hwaddr mapped_len = len;\n+    void *res = address_space_map(dev->vdev->dma_as, addr, &mapped_len,\n+                                  is_write, MEMTXATTRS_UNSPECIFIED);\n+    if (!res) {\n+        return NULL;\n+    }\n+    if (len != mapped_len) {\n+        address_space_unmap(dev->vdev->dma_as, res, mapped_len, 0, 0);\n+        return NULL;\n     }\n+    return res;\n }\n \n static void vhost_memory_unmap(struct vhost_dev *dev, void **buffer,\n@@ -481,17 +477,18 @@ static void vhost_memory_unmap(struct vhost_dev *dev, void **buffer,\n         return;\n     }\n \n-    if (!vhost_dev_has_iommu(dev)) {\n-        address_space_unmap(dev->vdev->dma_as, *buffer, len, is_write,\n-                            access_len);\n-    }\n-\n+    address_space_unmap(dev->vdev->dma_as, *buffer, len, is_write,\n+                        access_len);\n     *buffer = NULL;\n }\n \n static void vhost_vrings_unmap(struct vhost_dev *dev,\n                                struct vhost_virtqueue *vq, bool touched)\n {\n+    if (vhost_dev_has_iommu(dev)) {\n+        return;\n+    }\n+\n     vhost_memory_unmap(dev, &vq->used, vq->used_size, touched,\n                        touched ? vq->used_size : 0);\n     vhost_memory_unmap(dev, &vq->avail, vq->avail_size, 0,\n@@ -519,6 +516,14 @@ static int vhost_vrings_map(struct vhost_dev *dev,\n         /* Queue might not be ready for start */\n         return 0;\n     }\n+\n+    if (vhost_dev_has_iommu(dev)) {\n+        vq->desc = (void *)(uintptr_t)vq->desc_phys;\n+        vq->avail = (void *)(uintptr_t)vq->avail_phys;\n+        vq->used = (void *)(uintptr_t)vq->used_phys;\n+        return 1;\n+    }\n+\n     vq->desc = vhost_memory_map(dev, vq->desc_phys, vq->desc_size, false);\n     if (!vq->desc) {\n         goto fail;\n",
    "prefixes": [
        "05/10"
    ]
}