get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216906,
    "url": "http://patchwork.ozlabs.org/api/patches/2216906/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-32-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-32-peter.maydell@linaro.org>",
    "list_archive_url": null,
    "date": "2026-03-27T11:16:26",
    "name": "[v2,31/65] hw/intc/arm_gicv5: Implement IRS_PE_{CR0, SELR, STATUSR}",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b4ae4b37e16c6320d1df122728d72b4f1f381f79",
    "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-32-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/2216906/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216906/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=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=HD2Rk4VL;\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 4fhytH0gVKz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 22:22:47 +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 1w65CE-00072g-Er; Fri, 27 Mar 2026 07:17:46 -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 1w65C3-0006nl-DT\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:35 -0400",
            "from mail-wm1-x329.google.com ([2a00:1450:4864:20::329])\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 1w65C1-000822-4T\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:35 -0400",
            "by mail-wm1-x329.google.com with SMTP id\n 5b1f17b1804b1-486fb14227cso24721415e9.3\n for <qemu-devel@nongnu.org>; Fri, 27 Mar 2026 04:17:32 -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.30\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 04:17:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774610252; x=1775215052; 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=aRt8V9U0CkppqZyopaw8OtekbF4DU6MQ2QG3S20WAVo=;\n b=HD2Rk4VLF+MKesBYtu3KOBYiU2uPGp05PKU3FmtxfBfVk8cPrgyNfzGJe1vtChdZwM\n mmKK3VWp0PtBC5skkDcA9XTCE0Fr8D6YOvxl2A0U9YgYffWHWYPZPF3J2UvrvdnyHQP2\n 9M9SNMQ17AtcOyPREAJsWR3TD3fao7hCiCMGSUtty9QAk3r4j7FDfBuUUeaC+sMm5nuX\n 1qZAM3cebaP6grLdxC7ZxLwUXos0065z0g34B3ykm20uijic2N0VKzdlIP/jw5x0jMrW\n Sj5uCv82Sugxk0Rn7NBbIXIVf1ucmp3jFgyyCZ1H4rfSeCv5Tm0zueiNia/i+H9ewT3d\n WghA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774610252; x=1775215052;\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=aRt8V9U0CkppqZyopaw8OtekbF4DU6MQ2QG3S20WAVo=;\n b=PIDxYcUY9E421DM/yj33Run/k/14qidRqkJvkAyeg+Mz5uH/V+xMsUTM1a8FvVIk5f\n LsdqqxXLzhgvmBK34WsWrDtr5/wArdvKl60QJAluJ/1MacCJgzXVCReHXCttiv1lANKp\n hMfceNan1bLAU1mZHsWChCdfPyIt81p7v8F1qt42qF2rrazoptQZjEaw/OnQFE9xKHsm\n sfRH9Zbj/w0sWV9OFTitk6dnU8gINH1qh4+tgPJw8tswhQjyqvPxGVKOGfxIE8A7dS0V\n AikkP6KXojTargbKEb0/p6vLFbvRswk4X/lbr3dnBEIlgDzZbHcTfSZdWK0TtgDTl+Xt\n JKUg==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCVcoOjRh7Rv0M2HJ5kUV/o+OwHm7F7Kj8DvwUFVothuCRG2Qm+UeE3lJTpp0tXz3jTv/cAJLLlDHIfb@nongnu.org",
        "X-Gm-Message-State": "AOJu0YyFWe1TcwrXgJoexNW7skkEP5NHs39XDOwVAHYDAXpTHPzEsgf+\n ZJ3I5+2hC76OjCCh0dVh3Rg1irsWmlii+KjUtN9imIlxobDrVBAeTbgjQfhGzhQgsBE=",
        "X-Gm-Gg": "ATEYQzyRIrgQhON1TBANOzygRuF3+IekEozT5p5vpIhAqOh2qK/nWxuykQ3xqHxl6Iw\n h9qPrLE1RoMKFbnPQIFfZhMFviT6SfaHo/ogbIXxT4R24zRTDE07j1fEbGCdmFgn8u6lcqxEjIV\n j0VUmpXsHYlgXQsu0cbVPrQroKMcIWkMqubclyeTn8emKzNbvBhOWkUxuG3TiSe9J8fh7eMBVV9\n sXwx5wlnLEKY5Q8epIlinIE4/JqYFDV71Gt9swPjpFRMUgUTQ6w9t50CQN42U0MMQ1YwMv/rTZL\n 4v8czQH6RuOa028Wcw75fwJ7pN75USuLVSBkhBHOrD4Igqd4tI8POF//LFFZg04ky/hkUKzH5Fl\n sBQ6PG2FME65VOR5HFXvfZT70GtY+OmwkTvdUDZOec6gKntGfwvDpxy9THkInj5TAdhoR5BoLjL\n Yz+Zyw++C8m3YtYcPZmbgOWZX6SOYpmY8DTkxWVD3FuEKeWTRViOrhQaws2Dz4d1r7s+eBcm4M1\n bLj4hOViGE2UPmXrS4SuIMsS2fkL6o=",
        "X-Received": "by 2002:a05:600c:1546:b0:487:4eb:d125 with SMTP id\n 5b1f17b1804b1-48727ef0351mr33466895e9.9.1774610251476;\n Fri, 27 Mar 2026 04:17:31 -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 31/65] hw/intc/arm_gicv5: Implement IRS_PE_{CR0, SELR,\n STATUSR}",
        "Date": "Fri, 27 Mar 2026 11:16:26 +0000",
        "Message-ID": "<20260327111700.795099-32-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::329;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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": "The IRS_PE_CR0, IRS_PE_SELR, IRS_PE_STATUSR registers allow software\nto set and query per-CPU config.  Software writes the AFFID of a CPU\nto IRS_PE_SELR, and can then read and write the 1ofN config for that\nCPU to IRS_PE_CR0, and read the CPU's online status from\nIRS_PE_STATUSR.\n\nFor QEMU, we do not implement 1-of-N interrupt routing, so IRS_PE_CR0\ncan be RAZ/WI.  Our CPUs are always online and selecting a new one\nvia SELR is instantaneous, so IRS_PE_STATUSR will return either\nONLINE | V | IDLE if a valid AFFID was written to SELR, or just IDLE\nif an invalid AFFID was written.\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\nReviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>\n---\n hw/intc/arm_gicv5.c                | 39 ++++++++++++++++++++++++++++++\n hw/intc/arm_gicv5_common.c         |  1 +\n include/hw/intc/arm_gicv5_common.h |  1 +\n 3 files changed, 41 insertions(+)",
    "diff": "diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c\nindex 7b0d9e16c4..a95a9dc16b 100644\n--- a/hw/intc/arm_gicv5.c\n+++ b/hw/intc/arm_gicv5.c\n@@ -968,6 +968,21 @@ static void spi_sample(GICv5SPIState *spi)\n     }\n }\n \n+static bool irs_pe_selr_valid(GICv5Common *cs, GICv5Domain domain)\n+{\n+    /*\n+     * Return true if IRS_PE_SELR has a valid AFFID in it. We don't\n+     * expect the guest to do this except perhaps once at startup, so\n+     * do a simple linear scan through the cpu_iaffids array.\n+     */\n+    for (int i = 0; i < cs->num_cpu_iaffids; i++) {\n+        if (cs->irs_pe_selr[domain] == cs->cpu_iaffids[i]) {\n+            return true;\n+        }\n+    }\n+    return false;\n+}\n+\n static bool config_readl(GICv5 *s, GICv5Domain domain, hwaddr offset,\n                          uint64_t *data, MemTxAttrs attrs)\n {\n@@ -1091,6 +1106,24 @@ static bool config_readl(GICv5 *s, GICv5Domain domain, hwaddr offset,\n         /* Sync is a no-op for QEMU: we are always IDLE */\n         *data = R_IRS_SYNC_STATUSR_IDLE_MASK;\n         return true;\n+    case A_IRS_PE_SELR:\n+        *data = cs->irs_pe_selr[domain];\n+        return true;\n+    case A_IRS_PE_CR0:\n+        /* We don't implement 1ofN, so this is RAZ/WI for us */\n+        *data = 0;\n+        return true;\n+    case A_IRS_PE_STATUSR:\n+        /*\n+         * Our CPUs are always online, so we're really just reporting\n+         * whether the guest wrote a valid AFFID to IRS_PE_SELR\n+         */\n+        v = R_IRS_PE_STATUSR_IDLE_MASK;\n+        if (irs_pe_selr_valid(cs, domain)) {\n+            v |= R_IRS_PE_STATUSR_V_MASK | R_IRS_PE_STATUSR_ONLINE_MASK;\n+        }\n+        *data = v;\n+        return true;\n     }\n \n     return false;\n@@ -1179,6 +1212,12 @@ static bool config_writel(GICv5 *s, GICv5Domain domain, hwaddr offset,\n     case A_IRS_SYNCR:\n         /* Sync is a no-op for QEMU: ignore write */\n         return true;\n+    case A_IRS_PE_SELR:\n+        cs->irs_pe_selr[domain] = data;\n+        return true;\n+    case A_IRS_PE_CR0:\n+        /* We don't implement 1ofN, so this is RAZ/WI for us */\n+        return true;\n     }\n \n     return false;\ndiff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c\nindex b1c8ec4521..5510e6239a 100644\n--- a/hw/intc/arm_gicv5_common.c\n+++ b/hw/intc/arm_gicv5_common.c\n@@ -68,6 +68,7 @@ static void gicv5_common_reset_hold(Object *obj, ResetType type)\n     memset(cs->irs_ist_cfgr, 0, sizeof(cs->irs_ist_cfgr));\n     memset(cs->irs_cr0, 0, sizeof(cs->irs_cr0));\n     memset(cs->irs_cr1, 0, sizeof(cs->irs_cr1));\n+    memset(cs->irs_pe_selr, 0, sizeof(cs->irs_pe_selr));\n \n     if (cs->spi) {\n         GICv5Domain mp_domain;\ndiff --git a/include/hw/intc/arm_gicv5_common.h b/include/hw/intc/arm_gicv5_common.h\nindex ac0532abe8..34ad38c198 100644\n--- a/include/hw/intc/arm_gicv5_common.h\n+++ b/include/hw/intc/arm_gicv5_common.h\n@@ -86,6 +86,7 @@ struct GICv5Common {\n     uint32_t irs_spi_selr[NUM_GICV5_DOMAINS];\n     uint32_t irs_cr0[NUM_GICV5_DOMAINS];\n     uint32_t irs_cr1[NUM_GICV5_DOMAINS];\n+    uint32_t irs_pe_selr[NUM_GICV5_DOMAINS];\n \n     /*\n      * Pointer to an array of state information for the SPIs.  Array\n",
    "prefixes": [
        "v2",
        "31/65"
    ]
}