get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227434,
    "url": "http://patchwork.ozlabs.org/api/patches/2227434/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423173051.1999679-1-mattev@meta.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": "<20260423173051.1999679-1-mattev@meta.com>",
    "list_archive_url": null,
    "date": "2026-04-23T17:30:51",
    "name": "[v2] PCI/P2PDMA: Avoid returning a provider for non_mappable_bars",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0a6362aed2a5d3c44c352f3a68b52c8023adac68",
    "submitter": {
        "id": 93208,
        "url": "http://patchwork.ozlabs.org/api/people/93208/?format=api",
        "name": "Matt Evans",
        "email": "mattev@meta.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260423173051.1999679-1-mattev@meta.com/mbox/",
    "series": [
        {
            "id": 501226,
            "url": "http://patchwork.ozlabs.org/api/series/501226/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501226",
            "date": "2026-04-23T17:30:51",
            "name": "[v2] PCI/P2PDMA: Avoid returning a provider for non_mappable_bars",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/501226/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227434/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227434/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53059-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 (2048-bit key;\n unprotected) header.d=meta.com header.i=@meta.com header.a=rsa-sha256\n header.s=s2048-2025-q2 header.b=KoSQJ4QE;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53059-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=\"KoSQJ4QE\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=67.231.145.42",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=meta.com"
        ],
        "Received": [
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4g1jnQ3nmTz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 03:31:38 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 3C5D8300A623\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 17:31:36 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B4E971E7C12;\n\tThu, 23 Apr 2026 17:31:35 +0000 (UTC)",
            "from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com\n [67.231.145.42])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 381EB1D6DB5;\n\tThu, 23 Apr 2026 17:31:33 +0000 (UTC)",
            "from pps.filterd (m0044010.ppops.net [127.0.0.1])\n\tby mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63NH8qht1825687;\n\tThu, 23 Apr 2026 10:31:19 -0700",
            "from mail.thefacebook.com ([163.114.134.16])\n\tby mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4dpeph6ax8-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT);\n\tThu, 23 Apr 2026 10:31:19 -0700 (PDT)",
            "from localhost (2620:10d:c085:108::4) by mail.thefacebook.com\n (2620:10d:c08b:78::2ac9) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.37; Thu, 23 Apr\n 2026 17:31:18 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776965495; cv=none;\n b=p9lMwTwUxeqdSejlP3X0ha/PdyfY/k/hfd24JSM19sQjjUyHm62taZiggPO3ITdCRHI47dnYQpzd2NChqzB9u73GlA0aMYuWEGTox3wNvhZ7shlcmeTJmjwYlHXS7AUFI6Na8sV/fAw+EWJQ5NY+irzXfXOxhPJf4U7v3EC9c/U=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776965495; c=relaxed/simple;\n\tbh=5laPpylFZGIAGK4ze8/dFHPrMTjfLQovup6TursfZhU=;\n\th=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=PX7T2+hCx3PvQShbZMKBIVQQHPLOk3O//yxhjdAxyXXGT2W2CCv2fngP6+VNixJL8vEfRV2kTSHHNFyQ3/BHtX/HZQ6lxE8UNQAt/68J/ZY6fRKWoGkkxRmp959jTMZvZGRP3/kxs7IwNxuc3t6uVV3XWao2zR4LL5mzvAr9ioQ=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com;\n spf=pass smtp.mailfrom=meta.com;\n dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=KoSQJ4QE; arc=none smtp.client-ip=67.231.145.42",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc\n\t:content-transfer-encoding:content-type:date:from:message-id\n\t:mime-version:subject:to; s=s2048-2025-q2; bh=sl1X8lIyZ3uvIcv5XJ\n\tvNWiGMZFCkwqvQySCiFqrT/0w=; b=KoSQJ4QEmGtB+n0P5xENqiYPrxCLhFMRI1\n\tb1A4enVbbap7ZbKwFWzjGKnc9FQFu19txKMkiMQyunBlKa7iD8GZEiCO1WsOZ2a8\n\tFPnyYAKDrOu80K/cOYp4RMMm+Ee87Btgw6AP4z1juLix+q9FxCe8VlwNQrbbA86r\n\tVq3EiKsRDCQsTgBSCt55Cc0zjbvWa4XAa7UUX9sh2hSBvSJtsP/7v2ReVv4H5kuE\n\tlC/pbQu9AEDU2Vdg5ejS2EeAt+oZ1Lm6+dcUdVrClWDRtf2SstJlo48HHNIEZfhr\n\tZ30F6Z4hReOFE56dvYn5t/aw9JvQXeQQWMg19tTiCqQaQXHCEulg==",
        "From": "Matt Evans <mattev@meta.com>",
        "To": "Bjorn Helgaas <bhelgaas@google.com>,\n        Logan Gunthorpe\n\t<logang@deltatee.com>,\n        Ankit Agrawal <ankita@nvidia.com>, Leon Romanovsky\n\t<leon@kernel.org>,\n        Alex Williamson <alex@shazbot.org>,\n        Niklas Schnelle\n\t<schnelle@linux.ibm.com>",
        "CC": "<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>",
        "Subject": "[PATCH v2] PCI/P2PDMA: Avoid returning a provider for\n non_mappable_bars",
        "Date": "Thu, 23 Apr 2026 10:30:51 -0700",
        "Message-ID": "<20260423173051.1999679-1-mattev@meta.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "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-Type": "text/plain",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDIzMDE3MSBTYWx0ZWRfX78pEYXaywXR9\n 7nUdyoFEINho7IZ7lY2PU3MjFhjYqRRJFZ9HCp91oRwTbzzNRD036sEoAxiu5Sv+lsKlpeVA11W\n AZOqCFULlN0OQ3aqnAr16atEVlJuXxyHLgq1INxhdHrD+bqZansyiPNAE8F7Kn3qZngJlzqrsI9\n QozlFoRTEVaP80zReuei4g3r484p03S+fM5wujsDt5vuxaxSuFZqenZV0H/M1R5NwHocwRlYPTn\n NR6+LghgvIuB8W4YKUTgVMV2ZW+HuolNns0Ex1y7JC8+BaIMx64hEz67TlVwpc3UpHoLE/ZKfzI\n O2DUqYUauU5hgKqmzOqaZoVKYQBwuff0gxP0xQvYSmJyur3gIIhoALJw5VdbUainbM34IoKmZDi\n fENtAG/hoRmAvf8t3AqYfBbmNwh8gGtSWQjAd1QrzgRDhnrgg5VzseS98JtbMZCug2uBq/Szy2a\n zgmj8PtP87y0sMNo8kA==",
        "X-Proofpoint-GUID": "pr6pS-6pK0FJE7T4pft87PD_cUfgwYoM",
        "X-Proofpoint-ORIG-GUID": "pr6pS-6pK0FJE7T4pft87PD_cUfgwYoM",
        "X-Authority-Analysis": "v=2.4 cv=B8SJFutM c=1 sm=1 tr=0 ts=69ea5767 cx=c_pps\n a=CB4LiSf2rd0gKozIdrpkBw==:117 a=CB4LiSf2rd0gKozIdrpkBw==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=7x6HtfJdh03M6CCDgxCd:22\n a=8elwO82fXORLTBIkMd32:22 a=VwQbUJbxAAAA:8 a=VabnemYjAAAA:8\n a=LxoKb0BkxeglHS5Ch2kA:9 a=gKebqoRLp9LExxC7YDUY:22",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-23_03,2026-04-21_02,2025-10-01_01"
    },
    "content": "Extend the checks in pcim_p2pdma_init() and pcim_p2pdma_provider() to\nexclude functions that have pdev->non_mappable_bars set.\n\nConsumers such as VFIO were previously able to map these for access by\nthe CPU or P2P.  Update the comment on non_mappable_bars to show it\nrefers to any access, not just userspace CPU access.\n\nFixes: 372d6d1b8ae3c (\"PCI/P2PDMA: Refactor to separate core P2P functionality from memory allocation\")\nSigned-off-by: Matt Evans <mattev@meta.com>\n---\n\nThis arises from Alex Williamson's suggestion to test\nnon_mappable_bars when getting the provider, with discussion here:\n\n https://lore.kernel.org/kvm/20260415181623.1021090-1-mattev@meta.com/\n\nThe goal was to prevent a hole where VFIO could export DMABUFs for\nBARs marked non-mappable, and to fix for all users of the provider\nrather than just VFIO.  Alex observed that non_mappable_bars should be\ntaken to mean BARs weren't usable by the CPU _or_ peers and,\nconsidering that, its comment about userspace access wasn't quite\nright.\n\n== Changes ==\n\nv2:\n - Also test non_mappable_bars in pcim_p2pdma_init(), as\n   otherwise pci_p2pdma_add_resource() will WARN_ON\n   pcim_p2pdma_provider() failing.\n\nNiklas and Logan, I didn't re-add your R-B from v1 as (splitting\nhairs...) the code's changed.\n\nv1:\n https://lore.kernel.org/linux-pci/20260421174351.3897842-1-mattev@meta.com/\n\n\n drivers/pci/p2pdma.c | 6 +++++-\n include/linux/pci.h  | 2 +-\n 2 files changed, 6 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c\nindex 7c898542af8d..adb17a4f6939 100644\n--- a/drivers/pci/p2pdma.c\n+++ b/drivers/pci/p2pdma.c\n@@ -262,6 +262,9 @@ int pcim_p2pdma_init(struct pci_dev *pdev)\n \tstruct pci_p2pdma *p2p;\n \tint i, ret;\n \n+\tif (pdev->non_mappable_bars)\n+\t\treturn -EOPNOTSUPP;\n+\n \tp2p = rcu_dereference_protected(pdev->p2pdma, 1);\n \tif (p2p)\n \t\treturn 0;\n@@ -318,7 +321,8 @@ struct p2pdma_provider *pcim_p2pdma_provider(struct pci_dev *pdev, int bar)\n {\n \tstruct pci_p2pdma *p2p;\n \n-\tif (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))\n+\tif (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM) ||\n+\t    pdev->non_mappable_bars)\n \t\treturn NULL;\n \n \tp2p = rcu_dereference_protected(pdev->p2pdma, 1);\ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex 2c4454583c11..1e6802017d6b 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -508,7 +508,7 @@ struct pci_dev {\n \tunsigned int\tno_command_memory:1;\t/* No PCI_COMMAND_MEMORY */\n \tunsigned int\trom_bar_overlap:1;\t/* ROM BAR disable broken */\n \tunsigned int\trom_attr_enabled:1;\t/* Display of ROM attribute enabled? */\n-\tunsigned int\tnon_mappable_bars:1;\t/* BARs can't be mapped to user-space  */\n+\tunsigned int\tnon_mappable_bars:1;\t/* BARs can't be mapped by CPU or peers */\n \tpci_dev_flags_t dev_flags;\n \tatomic_t\tenable_cnt;\t/* pci_enable_device has been called */\n \n",
    "prefixes": [
        "v2"
    ]
}