get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216883,
    "url": "http://patchwork.ozlabs.org/api/patches/2216883/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-24-peter.maydell@linaro.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": "<20260327111700.795099-24-peter.maydell@linaro.org>",
    "list_archive_url": null,
    "date": "2026-03-27T11:16:18",
    "name": "[v2,23/65] hw/intc/arm_gicv5: Create backing state for SPIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e685566d399aed4f9e2c6e8b9c190cf8dec4b5f9",
    "submitter": {
        "id": 5111,
        "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api",
        "name": "Peter Maydell",
        "email": "peter.maydell@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-24-peter.maydell@linaro.org/mbox/",
    "series": [
        {
            "id": 497750,
            "url": "http://patchwork.ozlabs.org/api/series/497750/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497750",
            "date": "2026-03-27T11:16:25",
            "name": "arm: Implement an emulation of GICv5 interrupt controller",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/497750/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216883/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216883/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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=gJfd9yUp;\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 4fhypv6Q9xz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 22:19:51 +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 1w65C3-0006md-0d; Fri, 27 Mar 2026 07:17:35 -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 <peter.maydell@linaro.org>)\n id 1w65Bv-0006cc-Ty\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:27 -0400",
            "from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1w65Bt-0007xL-Kd\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:27 -0400",
            "by mail-wm1-x32a.google.com with SMTP id\n 5b1f17b1804b1-486fe655187so22895795e9.2\n for <qemu-devel@nongnu.org>; Fri, 27 Mar 2026 04:17:25 -0700 (PDT)",
            "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43b919cf2b2sm15484227f8f.18.2026.03.27.04.17.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 04:17:22 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774610244; x=1775215044; 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=UVKXKj+EMraPZwBBktCBK5IhDrOS5hbt+kqBhK1xkvE=;\n b=gJfd9yUpkeBJ398W9L0HlHMk/EjEhxEu/7Kx76ZIKvlHTuZoJkZe2OmY3/tfGmfO+o\n CJm/JMTB/r7KxR7H8j2E5zxAeUgb2Eowvn7by90sVTdJSVOMcXbGT2IvxRCb0DY/pdGD\n rWthOXI4AP71qblYg2/0++SNv2z9zrK45+6h17Snqz00hEFBADDPMH9RcCxQgT5I6g8f\n jgSiIWuVefKeIN+02RGQbinnPXPxygn3/IKC6hRg4onyJzTQV6BoL/u7vEUeRSfB4LEj\n BA5JHP2wNf6wUrBiqi5kGvyUnOmFfNedGN3LeXOQEYZGc96Sp0Apj702ZRfefGXAbazj\n BhNA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774610244; x=1775215044;\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=UVKXKj+EMraPZwBBktCBK5IhDrOS5hbt+kqBhK1xkvE=;\n b=QF69YwB8eII5iKlK/gFCVOuWAWBV2U7vIqztyfddtN/nSW7TWmEu9lr0pKrkF1riO7\n ci5ANIWQj4P/gmtjT19ADba0lr4tMSgYUVAlB8NTsdJyvU+Trx9Wvg0oS2wKbb+5oM1t\n rmvg0ZuspWKQEVlEctC8RHXml5VM27EXWx7koxWfko+ysbDGFL42EhauP5k1n08NVbVK\n 3fs0JETwDHAfW7hge8H7mYNZsbsWnUChqDqUoPJ2k1U2VSOJj5PPO4ckI8SpVxf6GGRw\n dFXXZTerBLcsJ1ostTLjFA8DT1ar0xtJwqX8XlJkO9TzZdbAcx7TlPbOtfxvEJR46plL\n UPmw==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCVpSHaMvYsKuUkVCpSjtKRqN8wbPWmgRA7VsjG7AXpcboOX7Jd0WUcRINo7G1utYA6WuKFTVshZf//A@nongnu.org",
        "X-Gm-Message-State": "AOJu0YxI5jHD9TuHk49sSIV9fFMw6WeO4bnisbN+/yd1rlVJ5FtKMQcr\n K3LRU9OET7JakpEOSZ10UeR4YbFxyg8OibSvnD7CFj/hzqFAU7CulObfQq03ptI228o=",
        "X-Gm-Gg": "ATEYQzx+oA5buEoBiRiiPkFkFsHiEHjmFRwQaXd+py3c2iYewDWRYh/Z7ik3NPmIvFt\n 06754wlKqJVuI9o5DrclgNAGlgOcBIdlHeKAd38Sjo6xGRCBMy1xfYgGqn8dmwdXKSGuhWGWgNe\n SaDHKVDmQIg1EGfz7zjvBJYH94hvAzS7gxFJGGSYeKr+X94FDiCqhgWDFX5Y6tmYGV8Ypvi8GVk\n OWhHhLIDC+/Lku//DCdThvzOU9PJ5IkTS23jnVVJWLE9qT5533JmaODxLT0mujppgx2IHPYkVdn\n tRjbRifvpGPvK87TLuxHYjiY5gPcv9LNfuvn4pPQCIwx+5zP6Q2iJp19uWGdN/HebWslqNXg6oA\n /CLiwVKv3GcgazMxIp/+iDKqqqm0LsNy+HNw+nRU871vRZ3xeGDoJ/evlSPzjxaaxsWNrYyCR1s\n tCR0byHMonPGBytQ5QmZz83zXgmFact63NlRTjs/TfF11z5dayq5B63CwzN9F6N7O4yIkfgztOD\n CcxW5cQoMWRZ8VXinhTKhJajeNokZE=",
        "X-Received": "by 2002:a05:600c:8b2a:b0:485:2c61:9457 with SMTP id\n 5b1f17b1804b1-48727d62cedmr34857025e9.10.1774610243959;\n Fri, 27 Mar 2026 04:17:23 -0700 (PDT)",
        "From": "Peter Maydell <peter.maydell@linaro.org>",
        "To": "qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org",
        "Cc": "Jonathan Cameron <jonathan.cameron@huawei.com>",
        "Subject": "[PATCH v2 23/65] hw/intc/arm_gicv5: Create backing state for SPIs",
        "Date": "Fri, 27 Mar 2026 11:16:18 +0000",
        "Message-ID": "<20260327111700.795099-24-peter.maydell@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260327111700.795099-1-peter.maydell@linaro.org>",
        "References": "<20260327111700.795099-1-peter.maydell@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::32a;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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=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": "The GICv5 allows an IRS to implement SPIs, which are fixed-wire\ninterrupts connected directly to the IRS.  For QEMU we want to use\nthese for all our traditional fixed-wire interrupt devices.  (The\nother option the architecture permits is an Interrupt Wire Bridge\n(IWB), which converts from a fixed-wire interrupt to an interrupt\nevent that is then translated through an ITS to send an LPI to the\nITS -- this is much more complexity than we need or want.)\n\nSPI configuration is set via the same CPUIF instructions as LPI\nconfiguration.  Create an array of structs which track the SPI state\ninformation listed in I_JVVTZ and I_BWPPP (ignoring for the moment\nthe VM assignment state, which we will add when we add virtualization\nsupport).\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\nReviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>\n---\n hw/intc/arm_gicv5_common.c         | 30 ++++++++++++++++++++++++++++++\n include/hw/intc/arm_gicv5_common.h | 27 +++++++++++++++++++++++++++\n include/hw/intc/arm_gicv5_types.h  | 14 ++++++++++++++\n 3 files changed, 71 insertions(+)",
    "diff": "diff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c\nindex 44909d1b05..79876c4401 100644\n--- a/hw/intc/arm_gicv5_common.c\n+++ b/hw/intc/arm_gicv5_common.c\n@@ -66,6 +66,34 @@ static void gicv5_common_reset_hold(Object *obj, ResetType type)\n \n     memset(cs->irs_ist_baser, 0, sizeof(cs->irs_ist_baser));\n     memset(cs->irs_ist_cfgr, 0, sizeof(cs->irs_ist_cfgr));\n+\n+    if (cs->spi) {\n+        GICv5Domain mp_domain;\n+\n+        /*\n+         * D_YGLYC, D_TVVRZ: SPIs reset to edge-triggered, inactive,\n+         * idle, disabled, targeted routing mode, not assigned to a\n+         * VM, and assigned to the most-privileged interrupt domain.\n+         * Other state is UNKNOWN: we choose to zero it.\n+         */\n+        memset(cs->spi, 0, cs->spi_irs_range * sizeof(*cs->spi));\n+\n+        /*\n+         * The most-privileged interrupt domain is effectively the\n+         * first in the list (EL3, S, NS) that we implement.\n+         */\n+        if (gicv5_domain_implemented(cs, GICV5_ID_EL3)) {\n+            mp_domain = GICV5_ID_EL3;\n+        } else if (gicv5_domain_implemented(cs, GICV5_ID_S)) {\n+            mp_domain = GICV5_ID_S;\n+        } else {\n+            mp_domain = GICV5_ID_NS;\n+        }\n+\n+        for (int i = 0; i < cs->spi_irs_range; i++) {\n+            cs->spi[i].domain = mp_domain;\n+        }\n+    }\n }\n \n static void gicv5_common_init(Object *obj)\n@@ -144,6 +172,8 @@ static void gicv5_common_realize(DeviceState *dev, Error **errp)\n \n     address_space_init(&cs->dma_as, cs->dma, \"gicv5-sysmem\");\n \n+    cs->spi = g_new0(GICv5SPIState, cs->spi_irs_range);\n+\n     trace_gicv5_common_realize(cs->irsid, cs->num_cpus,\n                                cs->spi_base, cs->spi_irs_range, cs->spi_range);\n }\ndiff --git a/include/hw/intc/arm_gicv5_common.h b/include/hw/intc/arm_gicv5_common.h\nindex 9bfafcebfc..d3f4999321 100644\n--- a/include/hw/intc/arm_gicv5_common.h\n+++ b/include/hw/intc/arm_gicv5_common.h\n@@ -53,6 +53,25 @@\n \n OBJECT_DECLARE_TYPE(GICv5Common, GICv5CommonClass, ARM_GICV5_COMMON)\n \n+/*\n+ * This is where we store the state the IRS handles for an SPI.\n+ * Generally this corresponds to the spec's list of state in I_JVVTZ\n+ * and J_BWPPP. level is a QEMU implementation detail and is where we\n+ * store the actual current state of the incoming qemu_irq line.\n+ */\n+typedef struct GICv5SPIState {\n+    uint32_t iaffid;\n+    uint8_t priority;\n+    bool level;\n+    bool pending;\n+    bool active;\n+    bool enabled;\n+    GICv5HandlingMode hm;\n+    GICv5RoutingMode irm;\n+    GICv5TriggerMode tm;\n+    GICv5Domain domain;\n+} GICv5SPIState;\n+\n /*\n  * This class is for common state that will eventually be shared\n  * between TCG and KVM implementations of the GICv5.\n@@ -65,6 +84,14 @@ struct GICv5Common {\n     uint64_t irs_ist_baser[NUM_GICV5_DOMAINS];\n     uint32_t irs_ist_cfgr[NUM_GICV5_DOMAINS];\n \n+    /*\n+     * Pointer to an array of state information for the SPIs.  Array\n+     * element 0 is SPI ID s->spi_base, and there are s->spi_irs_range\n+     * elements in total. SPI state is not per-domain: SPI is\n+     * configurable to a particular domain via IRS_SPI_DOMAINR.\n+     */\n+    GICv5SPIState *spi;\n+\n     /* Bits here are set for each physical interrupt domain implemented */\n     uint8_t implemented_domains;\n \ndiff --git a/include/hw/intc/arm_gicv5_types.h b/include/hw/intc/arm_gicv5_types.h\nindex 20de5b3f46..f6f8709a6a 100644\n--- a/include/hw/intc/arm_gicv5_types.h\n+++ b/include/hw/intc/arm_gicv5_types.h\n@@ -70,4 +70,18 @@ typedef enum GICv5RoutingMode {\n     GICV5_1OFN = 1,\n } GICv5RoutingMode;\n \n+/*\n+ * Interrupt trigger mode (same encoding as IRS_SPI_CFGR.TM) Note that\n+ * this is not the same thing as handling mode, even though the two\n+ * possible states have the same names. Trigger mode applies only for\n+ * SPIs and tells the IRS what kinds of changes to the input signal\n+ * wire should make it generate SET and CLEAR events.  Handling mode\n+ * affects whether the pending state of an interrupt is cleared when\n+ * the interrupt is acknowledged, and applies to both SPIs and LPIs.\n+ */\n+typedef enum GICv5TriggerMode {\n+    GICV5_TRIGGER_EDGE = 0,\n+    GICV5_TRIGGER_LEVEL = 1,\n+} GICv5TriggerMode;\n+\n #endif\n",
    "prefixes": [
        "v2",
        "23/65"
    ]
}