get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231627,
    "url": "http://patchwork.ozlabs.org/api/patches/2231627/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-7-mrathor@linux.microsoft.com/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api",
        "name": "Linux PCI development",
        "link_name": "linux-pci",
        "list_id": "linux-pci.vger.kernel.org",
        "list_email": "linux-pci@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260501004157.3108202-7-mrathor@linux.microsoft.com>",
    "list_archive_url": null,
    "date": "2026-05-01T00:41:52",
    "name": "[V2,06/11] mshv: Add ioctl support for MSHV-VFIO bridge device",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "645b971b908a7c9682a1d0ff50d7d75f27ef09ab",
    "submitter": {
        "id": 91512,
        "url": "http://patchwork.ozlabs.org/api/people/91512/?format=api",
        "name": "Mukesh R",
        "email": "mrathor@linux.microsoft.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-7-mrathor@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 502410,
            "url": "http://patchwork.ozlabs.org/api/series/502410/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=502410",
            "date": "2026-05-01T00:41:46",
            "name": "PCI passthru on Hyper-V (Part I)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/502410/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231627/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231627/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53564-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-pci@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com\n header.a=rsa-sha256 header.s=default header.b=GgEuZ+lV;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-pci+bounces-53564-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.microsoft.com\n header.i=@linux.microsoft.com header.b=\"GgEuZ+lV\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=13.77.154.182",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.microsoft.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.microsoft.com"
        ],
        "Received": [
            "from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6C2D1DdHz1y1d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 10:43:16 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 9766D30157B0\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 00:42:47 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id DD2F928D830;\n\tFri,  1 May 2026 00:42:19 +0000 (UTC)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 660492C08BB;\n\tFri,  1 May 2026 00:42:18 +0000 (UTC)",
            "from mrdev.corp.microsoft.com (unknown [40.86.183.173])\n\tby linux.microsoft.com (Postfix) with ESMTPSA id 845E120B717A;\n\tThu, 30 Apr 2026 17:42:17 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777596139; cv=none;\n b=jMQu/Ako1p9Jexnb2TnDxpM2gxaoMc8cDdoH1SqoKOJ7okpnWq6IbWr61PxqWBz+KTT0uVqBciqzjtdliP/PvKY38qYUakWrEmGyMh1dlwwAK67YoZZjyty9ybyPUaLlayYv5HXdrVrlu2KGmWNHhYEC2cLNLQ3UIn00QF7M+uc=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777596139; c=relaxed/simple;\n\tbh=C8TsFVJy+pAFOBhAef081HD3HUSmaQJnLst8p/bA8vk=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=bB1to2pgHwcmqkafINseDKV8c+6gzG1rD+1xgQB8MQ1thcuNWNNv4INqNC+RjjsZxJLcJWgqC7O36j3ffQz6kSIwuIDoc37kEqGXcDiz3Ou2azZh+hsQ4yCfRgjAU0SqcGmTpHBGOn9nQuvij3+H6Ki5e+Ng6Ulr5qMWbxZnzVA=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.microsoft.com;\n spf=pass smtp.mailfrom=linux.microsoft.com;\n dkim=pass (1024-bit key) header.d=linux.microsoft.com\n header.i=@linux.microsoft.com header.b=GgEuZ+lV;\n arc=none smtp.client-ip=13.77.154.182",
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 845E120B717A",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n\ts=default; t=1777596138;\n\tbh=torw1rFNIs6S4jLC1p2Rij05fcbQgV06MR8D7ovym88=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=GgEuZ+lV4+qhPCL+RnBEUNCxZUlH6K/GBrH4cMuvbt/TWi8/nT0UvnILg/Q7qQSaV\n\t pODWfGhx0Q1YUOgdlY+x4RseC/IZSIz5Y68iLZFSo59QzYivKLiBlCcihKxf+fHNke\n\t TGOm/u79XcxxEGqidmGPEr71nRiY3VsHG38nNCM4=",
        "From": "Mukesh R <mrathor@linux.microsoft.com>",
        "To": "hpa@zytor.com,\n\trobin.murphy@arm.com,\n\trobh@kernel.org,\n\twei.liu@kernel.org,\n\tmrathor@linux.microsoft.com,\n\tmhklinux@outlook.com,\n\tmuislam@microsoft.com,\n\tnamjain@linux.microsoft.com,\n\tmagnuskulke@linux.microsoft.com,\n\tanbelski@linux.microsoft.com,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-hyperv@vger.kernel.org,\n\tiommu@lists.linux.dev,\n\tlinux-pci@vger.kernel.org,\n\tlinux-arch@vger.kernel.org",
        "Cc": "kys@microsoft.com,\n\thaiyangz@microsoft.com,\n\tdecui@microsoft.com,\n\tlongli@microsoft.com,\n\ttglx@kernel.org,\n\tmingo@redhat.com,\n\tbp@alien8.de,\n\tdave.hansen@linux.intel.com,\n\tx86@kernel.org,\n\tjoro@8bytes.org,\n\twill@kernel.org,\n\tlpieralisi@kernel.org,\n\tkwilczynski@kernel.org,\n\tbhelgaas@google.com,\n\tarnd@arndb.de",
        "Subject": "[PATCH V2 06/11] mshv: Add ioctl support for MSHV-VFIO bridge device",
        "Date": "Thu, 30 Apr 2026 17:41:52 -0700",
        "Message-ID": "<20260501004157.3108202-7-mrathor@linux.microsoft.com>",
        "X-Mailer": "git-send-email 2.51.2.vfs.0.1",
        "In-Reply-To": "<20260501004157.3108202-1-mrathor@linux.microsoft.com>",
        "References": "<20260501004157.3108202-1-mrathor@linux.microsoft.com>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-pci@vger.kernel.org",
        "List-Id": "<linux-pci.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "Add ioctl support for creating MSHV devices for a partition. At\npresent only VFIO device types are supported, but more could be\nadded. At a high level, a partition ioctl to create device verifies\nit is of type VFIO and does some setup for bridge code in mshv_vfio.c.\nAdapted from KVM device ioctls.\n\nCo-developed-by: Wei Liu <wei.liu@kernel.org>\nSigned-off-by: Wei Liu <wei.liu@kernel.org>\nSigned-off-by: Mukesh R <mrathor@linux.microsoft.com>\n---\n drivers/hv/mshv_root_main.c | 116 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 116 insertions(+)",
    "diff": "diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c\nindex 02c107458be9..6ceb5f608589 100644\n--- a/drivers/hv/mshv_root_main.c\n+++ b/drivers/hv/mshv_root_main.c\n@@ -1625,6 +1625,119 @@ mshv_partition_ioctl_initialize(struct mshv_partition *partition)\n \treturn ret;\n }\n \n+static long mshv_device_attr_ioctl(struct mshv_device *mshv_dev, int cmd,\n+\t\t\t\t   ulong uarg)\n+{\n+\tstruct mshv_device_attr attr;\n+\tconst struct mshv_device_ops *devops = mshv_dev->device_ops;\n+\n+\tif (copy_from_user(&attr, (void __user *)uarg, sizeof(attr)))\n+\t\treturn -EFAULT;\n+\n+\tswitch (cmd) {\n+\tcase MSHV_SET_DEVICE_ATTR:\n+\t\tif (devops->device_set_attr)\n+\t\t\treturn devops->device_set_attr(mshv_dev, &attr);\n+\t\tbreak;\n+\tcase MSHV_HAS_DEVICE_ATTR:\n+\t\tif (devops->device_has_attr)\n+\t\t\treturn devops->device_has_attr(mshv_dev, &attr);\n+\t\tbreak;\n+\t}\n+\n+\treturn -EPERM;\n+}\n+\n+static long mshv_device_fop_ioctl(struct file *filp, unsigned int cmd,\n+\t\t\t\t  ulong uarg)\n+{\n+\tstruct mshv_device *mshv_dev = filp->private_data;\n+\n+\tswitch (cmd) {\n+\tcase MSHV_SET_DEVICE_ATTR:\n+\tcase MSHV_HAS_DEVICE_ATTR:\n+\t\treturn mshv_device_attr_ioctl(mshv_dev, cmd, uarg);\n+\t}\n+\n+\treturn -ENOTTY;\n+}\n+\n+static int mshv_device_fop_release(struct inode *inode, struct file *filp)\n+{\n+\tstruct mshv_device *mshv_dev = filp->private_data;\n+\tstruct mshv_partition *partition = mshv_dev->device_pt;\n+\n+\tif (mshv_dev->device_ops->device_release) {\n+\t\tmutex_lock(&partition->pt_mutex);\n+\t\thlist_del(&mshv_dev->device_ptnode);\n+\t\tmshv_dev->device_ops->device_release(mshv_dev);\n+\t\tmutex_unlock(&partition->pt_mutex);\n+\t}\n+\n+\tmshv_partition_put(partition);\n+\treturn 0;\n+}\n+\n+static const struct file_operations mshv_device_fops = {\n+\t.owner = THIS_MODULE,\n+\t.unlocked_ioctl = mshv_device_fop_ioctl,\n+\t.release = mshv_device_fop_release,\n+};\n+\n+static long mshv_partition_ioctl_create_device(struct mshv_partition *partition,\n+\t\t\t\t\t       void __user *uarg)\n+{\n+\tlong rc;\n+\tstruct mshv_create_device devargk;\n+\tstruct mshv_device *mshv_dev;\n+\tconst struct mshv_device_ops *vfio_ops;\n+\n+\tif (copy_from_user(&devargk, uarg, sizeof(devargk)))\n+\t\treturn -EFAULT;\n+\n+\t/* At present, only VFIO is supported */\n+\tif (devargk.type != MSHV_DEV_TYPE_VFIO)\n+\t\treturn -ENODEV;\n+\n+\tif (devargk.flags & MSHV_CREATE_DEVICE_TEST)\n+\t\treturn 0;\n+\n+\t/* This is freed later by mshv_vfio_release_device() */\n+\tmshv_dev = kzalloc(sizeof(*mshv_dev), GFP_KERNEL_ACCOUNT);\n+\tif (mshv_dev == NULL)\n+\t\treturn -ENOMEM;\n+\n+\tvfio_ops = &mshv_vfio_device_ops;\n+\tmshv_dev->device_ops = vfio_ops;\n+\tmshv_dev->device_pt = partition;\n+\n+\trc = vfio_ops->device_create(mshv_dev);\n+\tif (rc < 0) {\n+\t\tkfree(mshv_dev);\n+\t\treturn rc;\n+\t}\n+\n+\thlist_add_head(&mshv_dev->device_ptnode, &partition->pt_devices);\n+\n+\tmshv_partition_get(partition);\n+\trc = anon_inode_getfd(vfio_ops->device_name, &mshv_device_fops,\n+\t\t\t      mshv_dev, O_RDWR | O_CLOEXEC);\n+\tif (rc < 0)\n+\t\tgoto undo_out;\n+\n+\tdevargk.fd = rc;\n+\tif (copy_to_user(uarg, &devargk, sizeof(devargk)))\n+\t\treturn -EFAULT;    /* cleanup in mshv_device_fop_release() */\n+\n+\treturn 0;\n+\n+undo_out:\n+\thlist_del(&mshv_dev->device_ptnode);\n+\tvfio_ops->device_release(mshv_dev);    /* will kfree(mshv_dev) */\n+\tmshv_partition_put(partition);\n+\treturn rc;\n+}\n+\n static long\n mshv_partition_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)\n {\n@@ -1661,6 +1774,9 @@ mshv_partition_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)\n \tcase MSHV_ROOT_HVCALL:\n \t\tret = mshv_ioctl_passthru_hvcall(partition, true, uarg);\n \t\tbreak;\n+\tcase MSHV_CREATE_DEVICE:\n+\t\tret = mshv_partition_ioctl_create_device(partition, uarg);\n+\t\tbreak;\n \tdefault:\n \t\tret = -ENOTTY;\n \t}\n",
    "prefixes": [
        "V2",
        "06/11"
    ]
}