get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196656,
    "url": "http://patchwork.ozlabs.org/api/patches/2196656/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260215220422.212249-7-ltaylorsimpson@gmail.com/",
    "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": "<20260215220422.212249-7-ltaylorsimpson@gmail.com>",
    "list_archive_url": null,
    "date": "2026-02-15T22:04:20",
    "name": "[v2,6/8] Hexagon (target/hexagon) Disassembly of invalid packets",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9612ad19b06ef4d35134c55b2d2ee2e67ec10b54",
    "submitter": {
        "id": 86757,
        "url": "http://patchwork.ozlabs.org/api/people/86757/?format=api",
        "name": "Taylor Simpson",
        "email": "ltaylorsimpson@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260215220422.212249-7-ltaylorsimpson@gmail.com/mbox/",
    "series": [
        {
            "id": 492234,
            "url": "http://patchwork.ozlabs.org/api/series/492234/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492234",
            "date": "2026-02-15T22:04:17",
            "name": "Hexagon (target/hexagon) Check opcodes versions",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/492234/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196656/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196656/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=LJM+WJ+N;\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 4fDg370jsJz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 09:06:11 +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 1vrkEL-0005XO-Dx; Sun, 15 Feb 2026 17:04:41 -0500",
            "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 <ltaylorsimpson@gmail.com>)\n id 1vrkEI-0005Wn-36\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 17:04:38 -0500",
            "from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <ltaylorsimpson@gmail.com>)\n id 1vrkEG-00052R-9J\n for qemu-devel@nongnu.org; Sun, 15 Feb 2026 17:04:37 -0500",
            "by mail-ot1-x342.google.com with SMTP id\n 46e09a7af769-7d4c65d772cso2165977a34.1\n for <qemu-devel@nongnu.org>; Sun, 15 Feb 2026 14:04:35 -0800 (PST)",
            "from taylor-ubuntu.. (c-67-172-136-152.hsd1.co.comcast.net.\n [67.172.136.152]) by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-40eaf101db0sm13556664fac.12.2026.02.15.14.04.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 15 Feb 2026 14:04:33 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771193074; x=1771797874; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=h52ngLCzd/9lG0CAuePhG9DwNJOwalITs3nHRHFA3CA=;\n b=LJM+WJ+Nlmgjz/1ppZjXFt1lAQ1G0LevuoTq+99rlwMExhY1zKgMaPx4DJxDEuJeCE\n 7DY4msaXfjy9MtXtA4wSXjRmJqNAvbmVdgLK2r4doKtyplup5v3psBheWJk6cPw96JYG\n 8yK9/OBOTY7BdDvLWdvYVsnLKF0XQiY6YhkJo4gaxTA7itRI+QqVTzCCRasQ8+9Orbv+\n mU/UK1HI5D6fZLjpXNHzyMccrNH9a8V19LH1CHdSt13CeXY2MQb/R2sO2SBIkeM7aAFv\n 1V2ONDAbFhBfc67MB7c5NzpiSLMdChfW4OxpV53g+Hv3rh6M/O/lsUOV3Qle7PgdqyiV\n +Bhg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771193074; x=1771797874;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message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WGmORO/sQZdodaRmMsGSg\n 2YwkJ8w7qHIFXbk",
        "X-Received": "by 2002:a05:6820:f00a:b0:65f:6ae0:2944 with SMTP id\n 006d021491bc7-677694a0622mr5567954eaf.64.1771193073837;\n Sun, 15 Feb 2026 14:04:33 -0800 (PST)",
        "From": "Taylor Simpson <ltaylorsimpson@gmail.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "brian.cain@oss.qualcomm.com, matheus.bernardino@oss.qualcomm.com,\n sid.manning@oss.qualcomm.com, marco.liebel@oss.qualcomm.com,\n richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng,\n ltaylorsimpson@gmail.com",
        "Subject": "[PATCH v2 6/8] Hexagon (target/hexagon) Disassembly of invalid\n packets",
        "Date": "Sun, 15 Feb 2026 15:04:20 -0700",
        "Message-ID": "<20260215220422.212249-7-ltaylorsimpson@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260215220422.212249-1-ltaylorsimpson@gmail.com>",
        "References": "<20260215220422.212249-1-ltaylorsimpson@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::342;\n envelope-from=ltaylorsimpson@gmail.com; helo=mail-ot1-x342.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.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, FREEMAIL_FROM=0.001,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham 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": "We pass the Hexagon CPU version to disassemble_hexagon.  This allows\ndecode_packet to know if the opcodes are supported.\n\nNote that we print valid instructions in a packet when one or more is\ninvalid.  Rather than this\n0x0002128c:  0x1eae4fec\t{\t<invalid>\n0x00021290:  0x1c434c04\t\t<invalid>\n0x00021294:  0x1e03edf0\t\t<invalid> }\n\nWe print this\n0x0002128c:  0x1eae4fec\t{\t<invalid>\n0x00021290:  0x1c434c04\t\tV4.w = vadd(V12.w,V3.w)\n0x00021294:  0x1e03edf0\t\tV16 = V13 }\n\nCo-authored-by: Matheus Tavares Bernardino <matheus.bernardino@oss.qualcomm.com>\nCo-authored-by: Brian Cain <brian.cain@oss.qualcomm.com>\nSigned-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>\n---\n target/hexagon/cpu_bits.h  |  4 +++-\n target/hexagon/printinsn.h |  3 ++-\n disas/hexagon.c            |  3 ++-\n target/hexagon/cpu.c       |  3 +++\n target/hexagon/decode.c    | 22 ++++++++++++++++++----\n target/hexagon/printinsn.c |  9 +++++++--\n 6 files changed, 35 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/target/hexagon/cpu_bits.h b/target/hexagon/cpu_bits.h\nindex 19beca81c0..80d99f5df9 100644\n--- a/target/hexagon/cpu_bits.h\n+++ b/target/hexagon/cpu_bits.h\n@@ -19,6 +19,7 @@\n #define HEXAGON_CPU_BITS_H\n \n #include \"qemu/bitops.h\"\n+#include \"cpu-qom.h\"\n \n #define PCALIGN 4\n #define PCALIGN_MASK (PCALIGN - 1)\n@@ -65,6 +66,7 @@ static inline bool is_packet_end(uint32_t endocing)\n     return ((bits == 0x3) || (bits == 0x0));\n }\n \n-int disassemble_hexagon(uint32_t *words, int nwords, bfd_vma pc, GString *buf);\n+int disassemble_hexagon(uint32_t *words, int nwords, bfd_vma pc, GString *buf,\n+                        HexagonVersion hex_version);\n \n #endif\ndiff --git a/target/hexagon/printinsn.h b/target/hexagon/printinsn.h\nindex 2ecd1731d0..d437d35005 100644\n--- a/target/hexagon/printinsn.h\n+++ b/target/hexagon/printinsn.h\n@@ -18,10 +18,11 @@\n #ifndef HEXAGON_PRINTINSN_H\n #define HEXAGON_PRINTINSN_H\n \n+#include \"cpu-qom.h\"\n #include \"insn.h\"\n \n void snprint_a_pkt_disas(GString *buf, Packet *pkt, uint32_t *words,\n-                         target_ulong pc);\n+                         target_ulong pc, HexagonVersion hex_version);\n void snprint_a_pkt_debug(GString *buf, Packet *pkt);\n \n #endif\ndiff --git a/disas/hexagon.c b/disas/hexagon.c\nindex c1a4ffc5f6..9a18f12854 100644\n--- a/disas/hexagon.c\n+++ b/disas/hexagon.c\n@@ -31,6 +31,7 @@\n \n int print_insn_hexagon(bfd_vma memaddr, struct disassemble_info *info)\n {\n+    HexagonVersion hex_version = (HexagonVersion)info->target_info;\n     uint32_t words[PACKET_WORDS_MAX];\n     bool found_end = false;\n     GString *buf;\n@@ -58,7 +59,7 @@ int print_insn_hexagon(bfd_vma memaddr, struct disassemble_info *info)\n     }\n \n     buf = g_string_sized_new(PACKET_BUFFER_LEN);\n-    len = disassemble_hexagon(words, i, memaddr, buf);\n+    len = disassemble_hexagon(words, i, memaddr, buf, hex_version);\n     (*info->fprintf_func)(info->stream, \"%s\", buf->str);\n     g_string_free(buf, true);\n \ndiff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c\nindex 09a0de3c2f..4b16214ace 100644\n--- a/target/hexagon/cpu.c\n+++ b/target/hexagon/cpu.c\n@@ -314,8 +314,11 @@ static void hexagon_cpu_reset_hold(Object *obj, ResetType type)\n static void hexagon_cpu_disas_set_info(const CPUState *cs,\n                                        disassemble_info *info)\n {\n+    CPUState *cs_nonconst = (CPUState *)cs;  /* so we can get hex_cpu */\n+    HexagonCPU *hex_cpu = env_archcpu(cpu_env(cs_nonconst));\n     info->print_insn = print_insn_hexagon;\n     info->endian = BFD_ENDIAN_LITTLE;\n+    info->target_info = (void *)HEXAGON_CPU_GET_CLASS(hex_cpu)->hex_version;\n }\n \n static void hexagon_cpu_realize(DeviceState *dev, Error **errp)\ndiff --git a/target/hexagon/decode.c b/target/hexagon/decode.c\nindex b02a402dfa..4d95b7c690 100644\n--- a/target/hexagon/decode.c\n+++ b/target/hexagon/decode.c\n@@ -827,19 +827,33 @@ int decode_packet(DisasContext *ctx, int max_words, const uint32_t *words,\n \n /* Used for \"-d in_asm\" logging */\n int disassemble_hexagon(uint32_t *words, int nwords, bfd_vma pc,\n-                        GString *buf)\n+                        GString *buf, HexagonVersion hex_version)\n {\n     DisasContext ctx;\n     Packet pkt;\n \n     memset(&ctx, 0, sizeof(DisasContext));\n+    ctx.hex_version = HEX_VER_ANY;    /* Allow decode to accept anything */\n     ctx.pkt = &pkt;\n \n     if (decode_packet(&ctx, nwords, words, &pkt, true) > 0) {\n-        snprint_a_pkt_disas(buf, &pkt, words, pc);\n+        snprint_a_pkt_disas(buf, &pkt, words, pc, hex_version);\n         return pkt.encod_pkt_size_in_bytes;\n     } else {\n-        g_string_assign(buf, \"<invalid>\");\n-        return 0;\n+        for (int i = 0; i < nwords; i++) {\n+            g_string_append_printf(buf, \"0x\" TARGET_FMT_lx \"\\t\", words[i]);\n+            if (i == 0) {\n+                g_string_append(buf, \"{\");\n+            }\n+            g_string_append(buf, \"\\t\");\n+            g_string_append(buf, \"<invalid>\");\n+            if (i < nwords - 1) {\n+                pc += 4;\n+                g_string_append_printf(buf, \"\\n0x\" TARGET_FMT_lx \":  \",\n+                                       (target_ulong)pc);\n+            }\n+        }\n+        g_string_append(buf, \" }\");\n+        return nwords * sizeof(uint32_t);\n     }\n }\ndiff --git a/target/hexagon/printinsn.c b/target/hexagon/printinsn.c\nindex 4865cdd133..99f8020d5d 100644\n--- a/target/hexagon/printinsn.c\n+++ b/target/hexagon/printinsn.c\n@@ -21,6 +21,7 @@\n #include \"insn.h\"\n #include \"reg_fields.h\"\n #include \"internal.h\"\n+#include \"decode.h\"\n \n static const char *sreg2str(unsigned int reg)\n {\n@@ -51,7 +52,7 @@ static void snprintinsn(GString *buf, Insn *insn)\n }\n \n void snprint_a_pkt_disas(GString *buf, Packet *pkt, uint32_t *words,\n-                         target_ulong pc)\n+                         target_ulong pc, HexagonVersion hex_version)\n {\n     bool has_endloop0 = false;\n     bool has_endloop1 = false;\n@@ -83,7 +84,11 @@ void snprint_a_pkt_disas(GString *buf, Packet *pkt, uint32_t *words,\n         }\n \n         g_string_append(buf, \"\\t\");\n-        snprintinsn(buf, &(pkt->insn[i]));\n+        if (opcode_supported(pkt->insn[i].opcode, hex_version)) {\n+            snprintinsn(buf, &(pkt->insn[i]));\n+        } else {\n+            g_string_append(buf, \"<invalid>\");\n+        }\n \n         if (i < pkt->num_insns - 1) {\n             /*\n",
    "prefixes": [
        "v2",
        "6/8"
    ]
}