get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218243,
    "url": "http://patchwork.ozlabs.org/api/patches/2218243/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260331185219.12187-5-deller@kernel.org/",
    "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": "<20260331185219.12187-5-deller@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-31T18:52:15",
    "name": "[PULL,4/8] hw/pci-host/astro: Fix LMMIO DIRECT mappings",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "32562df96bfe6ef54329bf9cf7c8fc869c99dd35",
    "submitter": {
        "id": 87076,
        "url": "http://patchwork.ozlabs.org/api/people/87076/?format=api",
        "name": "Helge Deller",
        "email": "deller@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260331185219.12187-5-deller@kernel.org/mbox/",
    "series": [
        {
            "id": 498241,
            "url": "http://patchwork.ozlabs.org/api/series/498241/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498241",
            "date": "2026-03-31T18:52:18",
            "name": "[PULL,1/8] hw/pci-host/astro: Make astro address arrays accessible for other users",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498241/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218243/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218243/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 (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=K8BEqOo/;\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)"
        ],
        "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 4flchj0Mvwz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 05:53:41 +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 1w7eCW-0000Cf-Hg; Tue, 31 Mar 2026 14:52:32 -0400",
            "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 <deller@kernel.org>) id 1w7eCU-0000Bz-Hp\n for qemu-devel@nongnu.org; Tue, 31 Mar 2026 14:52:30 -0400",
            "from tor.source.kernel.org ([172.105.4.254])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <deller@kernel.org>) id 1w7eCT-0001XX-1j\n for qemu-devel@nongnu.org; Tue, 31 Mar 2026 14:52:30 -0400",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id 61234600AD;\n Tue, 31 Mar 2026 18:52:28 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 31F5CC19423;\n Tue, 31 Mar 2026 18:52:27 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1774983148;\n bh=MSh2k1y7oTk1fTpRYev8xiXj57dzEDFrCo0wWi7Vuyk=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=K8BEqOo/CAGiAWR26yId4trlB5gN2rZQ/FsxTcwAsdMTBs0U254lGowEDGxQ9IZ6l\n UW5w/I/q9LXQ3f0i+RfAOwXjGuVK0OYwqdu9ibfq8im8pbD52Wb8lQsK0jDN8Syx/B\n MevaiWjJWqZiS+dnOa1fFJs8df5eGM/S8RiNy/DZAOjvGBu6VjlrgiDgmxVBHqEddM\n H/eXJkAoLZHet6shGppHLrR6A8VMI8mD1k97UADr/ich2THmiQunSJ1xmmi6qpbM35\n rjoRUtkoGEhaKSvT1e5bPbwLHQSTvudfxF52ZgPR3uL3+Qq+VjWFiZisyPfPnG6iGQ\n tGgE+GEQgjDlQ==",
        "From": "Helge Deller <deller@kernel.org>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Helge Deller <deller@gmx.de>,\n Richard Henderson <richard.henderson@linaro.org>",
        "Subject": "[PULL 4/8] hw/pci-host/astro: Fix LMMIO DIRECT mappings",
        "Date": "Tue, 31 Mar 2026 20:52:15 +0200",
        "Message-ID": "<20260331185219.12187-5-deller@kernel.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260331185219.12187-1-deller@kernel.org>",
        "References": "<20260331185219.12187-1-deller@kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=172.105.4.254; envelope-from=deller@kernel.org;\n helo=tor.source.kernel.org",
        "X-Spam_score_int": "-5",
        "X-Spam_score": "-0.6",
        "X-Spam_bar": "/",
        "X-Spam_report": "(-0.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Helge Deller <deller@gmx.de>\n\nFix the existing code which has the mask wrong.\nImplement the direct mapping via overlapping subregion with priority 3\nto make sure the direct mapping gets precedence over the LMMIO region.\n\nSigned-off-by: Helge Deller <deller@gmx.de>\n---\n hw/pci-host/astro.c | 39 +++++++++++++++++++++++++--------------\n 1 file changed, 25 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c\nindex a0afa09198..b7760c4b32 100644\n--- a/hw/pci-host/astro.c\n+++ b/hw/pci-host/astro.c\n@@ -607,9 +607,13 @@ static void adjust_LMMIO_DIRECT_mapping(AstroState *s, unsigned int reg_index)\n     MemoryRegion *lmmio_alias;\n     unsigned int lmmio_index, map_route;\n     hwaddr map_addr;\n-    uint32_t map_size;\n+    uint32_t map_size, map_enabled;\n     struct ElroyState *elroy;\n \n+    /* each LMMIO may access from 1 MB up to 64 MB */\n+    const unsigned int lmmio_mask = ~(1 * MiB - 1);\n+    const unsigned int lmmio_max_size = 64 * MiB;\n+\n     /* pointer to LMMIO_DIRECT entry */\n     lmmio_index = reg_index / 3;\n     lmmio_alias = &s->lmmio_direct[lmmio_index];\n@@ -622,31 +626,38 @@ static void adjust_LMMIO_DIRECT_mapping(AstroState *s, unsigned int reg_index)\n     map_route &= (ELROY_NUM - 1);\n     elroy = s->elroy[map_route];\n \n+    /* make sure the lmmio region is initially turned off */\n     if (lmmio_alias->enabled) {\n         memory_region_set_enabled(lmmio_alias, false);\n     }\n \n+    /* do sanity checks and calculate mmio size */\n+    map_enabled = map_addr & 1;\n+    map_addr &= lmmio_mask;\n+    map_size &= lmmio_mask;\n+    map_size = MIN(map_size, lmmio_max_size);\n     map_addr = F_EXTEND(map_addr);\n-    map_addr &= TARGET_PAGE_MASK;\n-    map_size = (~map_size) + 1;\n-    map_size &= TARGET_PAGE_MASK;\n \n-    /* exit if disabled or zero map size */\n-    if (!(map_addr & 1) || !map_size) {\n+    /* exit if disabled or has zero size. */\n+    if (!map_enabled || !map_size) {\n         return;\n     }\n \n-    if (!memory_region_size(lmmio_alias)) {\n+    if (!lmmio_alias->name) {\n+        char lmmio_name[32];\n+        snprintf(lmmio_name, sizeof(lmmio_name),\n+                 \"LMMIO-DIRECT-%u\", lmmio_index);\n         memory_region_init_alias(lmmio_alias, OBJECT(elroy),\n-                        \"pci-lmmmio-alias\", &elroy->pci_mmio,\n+                        lmmio_name, &elroy->pci_mmio,\n                         (uint32_t) map_addr, map_size);\n-        memory_region_add_subregion(get_system_memory(), map_addr,\n-                                 lmmio_alias);\n-    } else {\n-        memory_region_set_alias_offset(lmmio_alias, map_addr);\n-        memory_region_set_size(lmmio_alias, map_size);\n-        memory_region_set_enabled(lmmio_alias, true);\n+        memory_region_add_subregion_overlap(get_system_memory(),\n+                        map_addr, lmmio_alias, 3);\n     }\n+\n+    memory_region_set_address(lmmio_alias, map_addr);\n+    memory_region_set_alias_offset(lmmio_alias, (uint32_t) map_addr);\n+    memory_region_set_size(lmmio_alias, map_size);\n+    memory_region_set_enabled(lmmio_alias, true);\n }\n \n static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,\n",
    "prefixes": [
        "PULL",
        "4/8"
    ]
}