get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2232515,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2232515/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260504-feat-mte4-v5-7-232a648e63c6@gmail.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": ""
    },
    "msgid": "<20260504-feat-mte4-v5-7-232a648e63c6@gmail.com>",
    "date": "2026-05-04T15:50:40",
    "name": "[v5,07/15] target/arm: add canonical tag check, mtx helpers",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0d6022f9b6ffdf2913c328f2eeb4ec95308e5e44",
    "submitter": {
        "id": 91863,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91863/?format=api",
        "name": "Gabriel Brookman",
        "email": "brookmangabriel@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260504-feat-mte4-v5-7-232a648e63c6@gmail.com/mbox/",
    "series": [
        {
            "id": 502688,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502688/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502688",
            "date": "2026-05-04T15:50:33",
            "name": "target/arm: add support for MTE4",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/502688/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2232515/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2232515/checks/",
    "tags": {},
    "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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=jpwFhAQA;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.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 4g8R503c0fz1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:53:24 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wJvZs-0000xs-0o; Mon, 04 May 2026 11:51:24 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <brookmangabriel@gmail.com>)\n id 1wJvZp-0000wg-Vm\n for qemu-devel@nongnu.org; Mon, 04 May 2026 11:51:22 -0400",
            "from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <brookmangabriel@gmail.com>)\n id 1wJvZo-0006DI-Es\n for qemu-devel@nongnu.org; Mon, 04 May 2026 11:51:21 -0400",
            "by mail-qt1-x829.google.com with SMTP id\n d75a77b69052e-50faf8ed9c5so20641341cf.2\n for <qemu-devel@nongnu.org>; Mon, 04 May 2026 08:51:20 -0700 (PDT)",
            "from [192.168.1.164] ([2600:1009:a021:c665:5296:905f:3e4a:eb90])\n by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-51040931552sm99599011cf.12.2026.05.04.08.51.17\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 04 May 2026 08:51:18 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777909879; x=1778514679; darn=nongnu.org;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=0ay7sf63ql1pC4xkROjc2QEdokR4pUfgyF6xPuvXHyY=;\n b=jpwFhAQA3H8TNCe2Lhuf0sYa58r8ZWVFwhKwdMSkFpKu3jBs7zo0jyyQwoSJJp66CY\n MuIDp3IwkBjbDZgs7XzT/aiLis5tsWWtgctyk/5ZhxIBwCX8Xhdt+AZxgUVfyJv245d+\n 1HW8dRGlXWpoU3JTveVyUeloF8AT4F8r6OAu5nAgYpeBN7/jYpiRf6wlcTKoY/q9MXXj\n fMya8z4xfsjZMcJlZ9Z6ANW1f84CqHeK84mDJKOrKTPEATL1wgX7MU4gSGlWPPld3hQ8\n o+FqlEaXhuxrUnDVal9q/pRAAieZwmP/4F9J29NEpYUEAjnVBFwIwh1F5YRROr+wt9nn\n Tdyw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777909879; x=1778514679;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=0ay7sf63ql1pC4xkROjc2QEdokR4pUfgyF6xPuvXHyY=;\n b=sYXRgXXsQRqyz8EjWzYzdZU32zVyR1Mo9BzAeOl7OhUcafzFJOUawwc/ESMxeTLMHq\n CLGGBxtZ24hHNBUXdLjZMT0RsnbEpi1EP72oAraleLapIZN2Ye1OCnx0nxnMxFexdq4K\n 8prD8rV/SvfOAHfED7nGzPVh++ycxPXxdWUZ/zwiDlIKZzUPe2bHU+lI6xR1NppXpE9N\n pGvr8XwSRYQzUF/FE5iYX2HBafJuKJruCmX9U+cAAEZ3apS34QRkacA3HMt0IPFt8BI8\n 1fwRVUDFT2iTOx4j1NYhbqacc9y04CLx+38dafoCPJZDg5gE3puBgUnZiUxmUThJDPnf\n csxQ==",
        "X-Gm-Message-State": "AOJu0YyUmGFobzta5HGl2avZYtRvMxBpJuphUOHwfG3Pr0fWvYGFdJud\n mkdNxFv/1IbztRgtJgqAKDbJ+ESnahkIAuILElig/VhANje8Wvh4z+hQ",
        "X-Gm-Gg": "AeBDiesmY2clRMKZfXv114Pirl6T/CnXNoy5jnOuEDOHOWPFP0S8lK3zgfpxTxZo7HO\n gPSvY5tCwYNjRBn88AzPZnCclff+sYQGXfH0IH7/fxgvJqCBmiRe2r6aYArZV65RDQmjU3jqfUP\n ZWwSgHHt5qdtwbszewcDkpiLWr+SYpGgaliaKmOwnVlzzZn5B074PjYxBqZzYLQAdmZ4CljV35v\n ABjtj+4330N8+LRqjGcwaAkMOBisf9gN0lXJ3KDRPwdbk0R8UZcFKZ9YDCFfv450SrXn8o0UEBc\n qDAFYdFDUIF6TGHb3KP3WKZryergyFzB3f0g2ZRGw+vWFSPCxdxcwi6Mebixbx406zgdarTSJrX\n ByDt/Kr1UM660QZRSzG1jVXPO7X96wIYZhICog5ZQByP3fchEr1hNTcTuj6JUqqMngtMbZ90P27\n YI2Gw2yra53ik6cuW0YJlZdi0T9uhfp9NueCBrRnBYjZl2z+wj6us=",
        "X-Received": "by 2002:ac8:6f1b:0:b0:50f:ec27:5d05 with SMTP id\n d75a77b69052e-5104be42610mr172075511cf.10.1777909879198;\n Mon, 04 May 2026 08:51:19 -0700 (PDT)",
        "From": "Gabriel Brookman <brookmangabriel@gmail.com>",
        "Date": "Mon, 04 May 2026 11:50:40 -0400",
        "Subject": "[PATCH v5 07/15] target/arm: add canonical tag check, mtx helpers",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260504-feat-mte4-v5-7-232a648e63c6@gmail.com>",
        "References": "<20260504-feat-mte4-v5-0-232a648e63c6@gmail.com>",
        "In-Reply-To": "<20260504-feat-mte4-v5-0-232a648e63c6@gmail.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Peter Maydell <peter.maydell@linaro.org>,\n Gustavo Romero <gustavo.romero@linaro.org>,\n Richard Henderson <richard.henderson@linaro.org>, qemu-arm@nongnu.org,\n Laurent Vivier <laurent@vivier.eu>,\n Gabriel Brookman <brookmangabriel@gmail.com>, Helge Deller <deller@gmx.de>,\n Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,\n Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>",
        "X-Mailer": "b4 0.15.2",
        "X-Developer-Signature": "v=1; a=ed25519-sha256; t=1777909867; l=1931;\n i=brookmangabriel@gmail.com; s=20251009; h=from:subject:message-id;\n bh=jN08kl5XFA9CgTscW9ExtHRwdhxwVdpjf5wqgUQUKtk=;\n b=WqGzwxpPuHocytpfhoh8lD7CZ/MuIC67VGaB9ynLdUiRiOcFSfl5c2s3SCyWcOOaP9d1RpNl6\n +ouCCAjjmCPAIHNCUBGvzQyPsLMalFgOshfYl3mACOX8DgU130ZPcsA",
        "X-Developer-Key": "i=brookmangabriel@gmail.com; a=ed25519;\n pk=m9TtPDal6WzoHNnQiHHKf8dTrv3DUCPUUTujuo8vNrw=",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::829;\n envelope-from=brookmangabriel@gmail.com; helo=mail-qt1-x829.google.com",
        "X-Spam_score_int": "-10",
        "X-Spam_score": "-1.1",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.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, FORGED_GMAIL_RCVD=1,\n FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n 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": "Add a helper that checks whether mtx is active from MTEDESC and a\nhelper that checks whether a tag matches the selector bit. These\nhelpers will be used for the subsequent commits.\n\nSigned-off-by: Gabriel Brookman <brookmangabriel@gmail.com>\n---\n target/arm/internals.h | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/target/arm/internals.h b/target/arm/internals.h\nindex 6df2c547c5..779eafabc8 100644\n--- a/target/arm/internals.h\n+++ b/target/arm/internals.h\n@@ -1629,6 +1629,12 @@ static inline uint64_t address_with_allocation_tag(uint64_t ptr, int rtag)\n     return deposit64(ptr, 56, 4, rtag);\n }\n \n+/* Return true if mtx bits mean that the access is canonically checked.  */\n+static inline bool mtx_check(uint32_t desc, int bit55)\n+{\n+    return (desc >> (R_MTEDESC_MTX_SHIFT + bit55)) & 1;\n+}\n+\n /* Return true if tbi or mtx bits mean that the access is tag checked.  */\n static inline bool tbi_or_mtx_check(uint32_t desc, int bit55)\n {\n@@ -1636,6 +1642,12 @@ static inline bool tbi_or_mtx_check(uint32_t desc, int bit55)\n     return desc & (mask << bit55);\n }\n \n+/* Return whether or not the second nibble of a VA matches bit 55.  */\n+static inline bool tag_is_canonical(int ptr_tag, int bit55)\n+{\n+    return ((ptr_tag + bit55) & 0xf) == 0;\n+}\n+\n /* Return true if tcma bits mean that the access is unchecked.  */\n static inline bool tcma_check(uint32_t desc, int bit55, int ptr_tag)\n {\n@@ -1643,7 +1655,7 @@ static inline bool tcma_check(uint32_t desc, int bit55, int ptr_tag)\n      * We had extracted bit55 and ptr_tag for other reasons, so fold\n      * (ptr<59:55> == 00000 || ptr<59:55> == 11111) into a single test.\n      */\n-    bool match = ((ptr_tag + bit55) & 0xf) == 0;\n+    bool match = tag_is_canonical(ptr_tag, bit55);\n     bool tcma = (desc >> (R_MTEDESC_TCMA_SHIFT + bit55)) & 1;\n     return tcma && match;\n }\n",
    "prefixes": [
        "v5",
        "07/15"
    ]
}