get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231626,
    "url": "http://patchwork.ozlabs.org/api/patches/2231626/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260501004157.3108202-4-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-4-mrathor@linux.microsoft.com>",
    "list_archive_url": null,
    "date": "2026-05-01T00:41:49",
    "name": "[V2,03/11] mshv: Provide a way to get partition id if running in a VMM process",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "dbaa705678d8c52de7ee7a0aebc8fd0b04221633",
    "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-4-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/2231626/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231626/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53561-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=AY1QqX63;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-53561-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=\"AY1QqX63\"",
            "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\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 4g6C1x3pgcz1y1d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 10:43:01 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 8A5E3302C35C\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  1 May 2026 00:42:29 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A973C29AB02;\n\tFri,  1 May 2026 00:42:16 +0000 (UTC)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B240128727D;\n\tFri,  1 May 2026 00:42:13 +0000 (UTC)",
            "from mrdev.corp.microsoft.com (unknown [40.86.183.173])\n\tby linux.microsoft.com (Postfix) with ESMTPSA id 8717F20B716D;\n\tThu, 30 Apr 2026 17:42:12 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777596136; cv=none;\n b=pMrp62UOYudUvkidFVsAqHNEoLcnUX+EfJ5QkhvCvlRBnMX0nkoHwQ+hDiZ+wh5b/rQKt9FCXBXA/795pOtzgL+iKKVO+cvsclQxkjcES2NeOpe9cP8wycmzu0XMPMIeh1i/AG916jLhfjOqceUhJguIBNnTQGyYnjOwJAtqhiw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777596136; c=relaxed/simple;\n\tbh=RL8CMF9VtgQzgIX0JTCcMJjTzHoMPhPoxAA/GgN4+eg=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=KmgmouWV3u0xGXcltUAdzqzZ0Fn7mRdD8ugu1QWkZyJ6xCkPgPJk2XxvA/sn39WjPgE1GPs7Cq/PYg2w1jmvcsc+2XSdp8I96Lh7r61z3/EDrj5MXPvVcogoiOwFfp8k/T2hbiRaGp7wiW/4UhDC5tHChGye8qvTgKnSfezbgac=",
        "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=AY1QqX63;\n arc=none smtp.client-ip=13.77.154.182",
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 8717F20B716D",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n\ts=default; t=1777596133;\n\tbh=kCeRxeZ+DxLmt1F1HSGhNkVBu6/HNQhxryO/F6KU6U0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=AY1QqX632IgZ7EMmVmvrRSlMIZIoqZR/YDVPw0qU+MZSpqUne0ynyVENNd1Yu06aI\n\t zCcQnVnmp0fqJf93kmCwrjc5Zf1ibhAaUHbUrbvdb7MRNAvxZxozVY0fxyXjkYquXF\n\t ipommmfLx8ZgXWQ8zn3dtXwRSXwd28KAPv/q255Q=",
        "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 03/11] mshv: Provide a way to get partition id if running\n in a VMM process",
        "Date": "Thu, 30 Apr 2026 17:41:49 -0700",
        "Message-ID": "<20260501004157.3108202-4-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": "Many PCI passthru related hypercalls require partition id of the target\nguest. Guests are actually managed by MSHV driver and the partition id\nis only maintained there. Add a field in the partition struct in MSHV\ndriver to save the tgid of the VMM process creating the partition,\nand add a function there to retrieve partition id if current process\nis a VMM process.\n\nReviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>\nSigned-off-by: Mukesh R <mrathor@linux.microsoft.com>\n---\n drivers/hv/mshv_root.h         |  1 +\n drivers/hv/mshv_root_main.c    | 22 ++++++++++++++++++++++\n include/asm-generic/mshyperv.h |  5 +++++\n 3 files changed, 28 insertions(+)",
    "diff": "diff --git a/drivers/hv/mshv_root.h b/drivers/hv/mshv_root.h\nindex 1f086dcb7aa1..a85c24dcc701 100644\n--- a/drivers/hv/mshv_root.h\n+++ b/drivers/hv/mshv_root.h\n@@ -138,6 +138,7 @@ struct mshv_partition {\n \n \tstruct mshv_girq_routing_table __rcu *pt_girq_tbl;\n \tu64 isolation_type;\n+\tpid_t pt_vmm_tgid;\n \tbool import_completed;\n \tbool pt_initialized;\n #if IS_ENABLED(CONFIG_DEBUG_FS)\ndiff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c\nindex bd1359eb58dd..02c107458be9 100644\n--- a/drivers/hv/mshv_root_main.c\n+++ b/drivers/hv/mshv_root_main.c\n@@ -1908,6 +1908,27 @@ mshv_partition_release(struct inode *inode, struct file *filp)\n \treturn 0;\n }\n \n+/* Given a process tgid, return partition id if it is a VMM process */\n+u64 mshv_current_partid(void)\n+{\n+\tstruct mshv_partition *pt;\n+\tint i;\n+\tu64 ret_ptid = HV_PARTITION_ID_INVALID;\n+\n+\trcu_read_lock();\n+\n+\thash_for_each_rcu(mshv_root.pt_htable, i, pt, pt_hnode) {\n+\t\tif (pt->pt_vmm_tgid == current->tgid) {\n+\t\t\tret_ptid = pt->pt_id;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\trcu_read_unlock();\n+\treturn ret_ptid;\n+}\n+EXPORT_SYMBOL_GPL(mshv_current_partid);\n+\n static int\n add_partition(struct mshv_partition *partition)\n {\n@@ -2073,6 +2094,7 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)\n \t\tgoto cleanup_irq_srcu;\n \n \tpartition->pt_id = pt_id;\n+\tpartition->pt_vmm_tgid = current->tgid;\n \n \tret = add_partition(partition);\n \tif (ret)\ndiff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h\nindex bf601d67cecb..e8cbc4e3f7ad 100644\n--- a/include/asm-generic/mshyperv.h\n+++ b/include/asm-generic/mshyperv.h\n@@ -350,6 +350,7 @@ int hv_call_add_logical_proc(int node, u32 lp_index, u32 acpi_id);\n int hv_call_notify_all_processors_started(void);\n bool hv_lp_exists(u32 lp_index);\n int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags);\n+u64 mshv_current_partid(void);\n \n #else /* CONFIG_MSHV_ROOT */\n static inline bool hv_root_partition(void) { return false; }\n@@ -380,6 +381,10 @@ static inline int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u3\n {\n \treturn -EOPNOTSUPP;\n }\n+static inline u64 mshv_current_partid(void)\n+{\n+\treturn HV_PARTITION_ID_INVALID;\n+}\n #endif /* CONFIG_MSHV_ROOT */\n \n static inline int hv_deposit_memory(u64 partition_id, u64 status)\n",
    "prefixes": [
        "V2",
        "03/11"
    ]
}