get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227699,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2227699/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424050509.3935180-2-frank.chang@sifive.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": "<20260424050509.3935180-2-frank.chang@sifive.com>",
    "date": "2026-04-24T05:05:08",
    "name": "[v4,1/2] target/riscv: Update MISA.C for Zc* extensions",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d0a373264e66ea0f4085d00e0c4981e9630f7eeb",
    "submitter": {
        "id": 79604,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/79604/?format=api",
        "name": "Frank Chang",
        "email": "frank.chang@sifive.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260424050509.3935180-2-frank.chang@sifive.com/mbox/",
    "series": [
        {
            "id": 501301,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501301/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501301",
            "date": "2026-04-24T05:05:08",
            "name": "Set MISA.[C|X] based on the selected extensions",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/501301/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227699/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227699/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=sifive.com header.i=@sifive.com header.a=rsa-sha256\n header.s=google header.b=koBfIg+C;\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 4g21C10xp8z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 15:06:19 +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 1wG8jC-0003vA-SG; Fri, 24 Apr 2026 01:05:22 -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 <frank.chang@sifive.com>)\n id 1wG8jB-0003uH-5y\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 01:05:21 -0400",
            "from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <frank.chang@sifive.com>)\n id 1wG8j9-0005pX-MZ\n for qemu-devel@nongnu.org; Fri, 24 Apr 2026 01:05:20 -0400",
            "by mail-pf1-x433.google.com with SMTP id\n d2e1a72fcca58-824c9da9928so3750399b3a.3\n for <qemu-devel@nongnu.org>; Thu, 23 Apr 2026 22:05:19 -0700 (PDT)",
            "from hsinchu16.internal.sifive.com ([210.176.154.34])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82f8e981992sm26698554b3a.7.2026.04.23.22.05.15\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 23 Apr 2026 22:05:16 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=sifive.com; s=google; t=1777007118; x=1777611918; 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=Eggucli4qTqnT+0XjlTx/9JXPvjlpybl8ngBYSrfqOw=;\n b=koBfIg+Cxlttp5gmfxOnRtfI9UOVRP3ZP4eO5zeW+2sFKi+xohdiCEosmyzU9dtnMT\n hQwv9HYhq3MU6/I9LtWAPIUYUlO8i9ogJ9Ttmm4OOrlsa5Zjgfxut7Bi9rIkl9U29fsF\n QNTBdEGl32kQ9VqGBvYwaNNmKd8Qa7cFLNtSnUVn8X/DAjNenIEnBkVyJPnq0Ap+fn7l\n I8f0V4Zq1y6ZVjTJxvaUI4aR65PcC7A1mKme7JK/9GIaRfMg/Qh4wsuUowmiw3g3NBG6\n pa7hXsSVOn0BA0n95VZW9H5+z3NGJeTf4h6VjbnzghcNKcocmQtq65UF9HBAc+NXyq3Y\n IdDg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777007118; x=1777611918;\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-id:reply-to;\n bh=Eggucli4qTqnT+0XjlTx/9JXPvjlpybl8ngBYSrfqOw=;\n b=GO7+VJAXFUoB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1HDLBxdEQ5U7K\n UC1Jcec2ZF47hSovoarTKzHIyunVuHujy1U/qBu/jVmzATbWj7JFvUnCichntX",
        "X-Received": "by 2002:a05:6a00:ab8c:b0:829:800b:9fe with SMTP id\n d2e1a72fcca58-82f8c99a9a3mr32737654b3a.39.1777007117407;\n Thu, 23 Apr 2026 22:05:17 -0700 (PDT)",
        "From": "frank.chang@sifive.com",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Palmer Dabbelt <palmer@dabbelt.com>,\n Alistair Francis <alistair.francis@wdc.com>,\n Weiwei Li <liwei1518@gmail.com>,\n Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,\n Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,\n Chao Liu <chao.liu.zevorn@gmail.com>,\n qemu-riscv@nongnu.org (open list:RISC-V TCG CPUs),\n Frank Chang <frank.chang@sifive.com>, Max Chou <max.chou@sifive.com>",
        "Subject": "[PATCH v4 1/2] target/riscv: Update MISA.C for Zc* extensions",
        "Date": "Fri, 24 Apr 2026 13:05:08 +0800",
        "Message-ID": "<20260424050509.3935180-2-frank.chang@sifive.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260424050509.3935180-1-frank.chang@sifive.com>",
        "References": "<20260424050509.3935180-1-frank.chang@sifive.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::433;\n envelope-from=frank.chang@sifive.com; helo=mail-pf1-x433.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,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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: Frank Chang <frank.chang@sifive.com>\n\nMISA.C is set if the following extensions are selected:\n  * Zca and not F.\n  * Zca, Zcf and F (but not D) is specified (RV32 only).\n  * Zca, Zcf and Zcd if D is specified (RV32 only).\n  * Zca, Zcd if D is specified (RV64 only).\n\nTherefore, MISA.C must be set according to the Zc* extension rules.\n\nWarn the user if RVC is explicitly disabled but MISA.C is required by\nthe rules above.\n\nSigned-off-by: Frank Chang <frank.chang@sifive.com>\nReviewed-by: Max Chou <max.chou@sifive.com>\n---\n target/riscv/tcg/tcg-cpu.c | 39 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 39 insertions(+)",
    "diff": "diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c\nindex f3f78088956..5db166c01e9 100644\n--- a/target/riscv/tcg/tcg-cpu.c\n+++ b/target/riscv/tcg/tcg-cpu.c\n@@ -1163,6 +1163,44 @@ static void riscv_cpu_enable_implied_rules(RISCVCPU *cpu)\n     }\n }\n \n+/*\n+ * MISA.C is set if the following extensions are selected:\n+ *   - Zca and not F.\n+ *   - Zca, Zcf and F (but not D) is specified on RV32.\n+ *   - Zca, Zcf and Zcd if D is specified on RV32.\n+ *   - Zca, Zcd if D is specified on RV64.\n+ */\n+static void riscv_cpu_update_misa_c(RISCVCPU *cpu)\n+{\n+    CPURISCVState *env = &cpu->env;\n+    bool set_misa_c = false;\n+\n+    if (riscv_has_ext(env, RVC)) {\n+        return;\n+    }\n+\n+    if (cpu->cfg.ext_zca && !riscv_has_ext(env, RVF)) {\n+        set_misa_c = true;\n+    } else if (riscv_cpu_mxl(env) == MXL_RV32 &&\n+               cpu->cfg.ext_zca && cpu->cfg.ext_zcf &&\n+               (riscv_has_ext(env, RVD) ? cpu->cfg.ext_zcd :\n+                                          riscv_has_ext(env, RVF))) {\n+        set_misa_c = true;\n+    } else if (riscv_cpu_mxl(env) == MXL_RV64 &&\n+               cpu->cfg.ext_zca && cpu->cfg.ext_zcd) {\n+        set_misa_c = true;\n+    }\n+\n+    if (set_misa_c) {\n+        if (cpu_misa_ext_is_user_set(RVC)) {\n+            warn_report(\"RVC mandated by Zca/Zcf/Zcd extensions\");\n+            return;\n+        }\n+\n+        riscv_cpu_set_misa_ext(env, env->misa_ext | RVC);\n+    }\n+}\n+\n void riscv_tcg_cpu_finalize_features(RISCVCPU *cpu, Error **errp)\n {\n     CPURISCVState *env = &cpu->env;\n@@ -1170,6 +1208,7 @@ void riscv_tcg_cpu_finalize_features(RISCVCPU *cpu, Error **errp)\n \n     riscv_cpu_init_implied_exts_rules();\n     riscv_cpu_enable_implied_rules(cpu);\n+    riscv_cpu_update_misa_c(cpu);\n \n     riscv_cpu_validate_misa_priv(env, &local_err);\n     if (local_err != NULL) {\n",
    "prefixes": [
        "v4",
        "1/2"
    ]
}