get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216874,
    "url": "http://patchwork.ozlabs.org/api/patches/2216874/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-35-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-35-peter.maydell@linaro.org>",
    "list_archive_url": null,
    "date": "2026-03-27T11:16:29",
    "name": "[v2,34/65] target/arm: GICv5 cpuif: Implement ICC_IAFFIDR_EL1",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f5ba15f3b3b964515bf5056ba2973121daf5f343",
    "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-35-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/2216874/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216874/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=A4in92nW;\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 4fhymy1NPdz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 22:18:10 +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 1w65C9-0006wO-FJ; Fri, 27 Mar 2026 07:17:41 -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 1w65C6-0006sm-U0\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:38 -0400",
            "from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f])\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 1w65C4-000880-EC\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:38 -0400",
            "by mail-wr1-x42f.google.com with SMTP id\n ffacd0b85a97d-439b9cf8cb5so1919286f8f.0\n for <qemu-devel@nongnu.org>; Fri, 27 Mar 2026 04:17:35 -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.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 04:17:33 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774610255; x=1775215055; 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=xnrF8FhdNtpjJjbzEATZqeP00jwVSkGfClNmWr825JA=;\n b=A4in92nWcDOxy2BWz68UynPFwiaFQgA8xORFoJRvimQY+QHDJXfOMFcpUxfqUgBbNg\n xYV8n0sckj8a7P91ISFPniRklhqC53nfurnNSNLiFXum5dTloD/9bNxwwq1cXtHpR25A\n txh/O64kVJxj9keXj1mK9nCsK/BnYV7dqa92KsEZG0tTeira116isj3altEOBbywA1b3\n lMva/ZykR1xUAwig6j+YDhAwmLT47ITNTSblkdF4yl+9hgBQzrFruC9Dlw3C4Nruo8g9\n wd8lZvz83O2rRBkf9XQ1KgJKM/kqD76CDYljG461tCwppyOl+z23JUX6addv43DjGBeK\n fmNQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774610255; x=1775215055;\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=xnrF8FhdNtpjJjbzEATZqeP00jwVSkGfClNmWr825JA=;\n b=J2sVBOQhkvY2iONiloiSfbAyu7k/APkTOOJ9QnBJRaxp9xbgHFQpfG8M0vlWk9Eaeb\n thQV6hufWK/2R76WHCapS2o16qg3l+owE3tm05yCmKXxS9UHxpt/l5u99eyi3AWYiiL0\n Ui4v39LL8EmLVWnSLq11xV8ZHEz6w+I5T8URmB3CBaVcK9H34n2iZkGdoD/yWvhvAkF1\n DxjMnHFyQWd33Q2FP9Bdqzq93vpsxtf/f9EXueDtwRMx78IlAY+9EBJkiaZwmwtX0/Vu\n 09Go58nSvvHlxnNK+b57PouxqJrEsSYg2MwmPIgHpHyxunQTzA2uRsZq2REttVaOcjis\n om1A==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCVNTQSwLah2bufYl1zxFeTfAbSuqiLqajtnVhEF6Qtl0z9w7LD0+9+gRd4TQo5sJHhhratJi7J56IFi@nongnu.org",
        "X-Gm-Message-State": "AOJu0YxgNJWgg96SjDyycxMYWo3SVVCw7z5UUqmy0GaaJxmu6Juc/g99\n /6ZvMipEAfCwfuqRWv6EJMwX9/FGTc6YOjwG/L0G/ADEYwfY08PAaC85OJLnrMmz+TA=",
        "X-Gm-Gg": "ATEYQzyQkGU7DEwesvhjh4gthhIAQA/o74h3+813uBz+RwDFjHcu3NU/d6qz5P7HhK8\n GeZN84LkNInBdds3c90+9BANzooByw6IZDABU+toOTnod3afABgK6+1uNk6YdgwK/TGhiQbO5f1\n nMXeHrf0xOMdxF9l8EQHs4yopu500AFbqyGpR8GH6uQ35OZwb5TgCyzjf6MsuYFCcs+EjZSfqj9\n Ae6In+ga32wYuJH+rGNcyBq9FKiipq0zBtrMAKxKZAdZ8rhcx6EzsXr3w7I28WzgbD0xE66WE9/\n pzJlck52avZNH2/g4O5v3xuocwHt0k31Untun5T/AhxVaUi69XZ5gq8XI+gwbSoS58aNfYYKka/\n NZb5lUcrKgBoCTMLHKQ2YuWy+7Q2gejwIWPHzHdxcEMhQ9n5g5ewIXwlT0jeq/NU/4HumSh4+ek\n A6y4CSiySgfSb/lORgGERHezhd55P4cPLjW1+H9rrWxwqPW1tIZpWPBXRbAQNKbIIE/eEeK5rlO\n FgscyY9lJ+uCObcRXLE8UMv6kL/xr3gcGKlsf6tnQ==",
        "X-Received": "by 2002:a05:6000:200c:b0:43b:8f4e:27f8 with SMTP id\n ffacd0b85a97d-43b9ea34a8cmr3174268f8f.12.1774610254831;\n Fri, 27 Mar 2026 04:17:34 -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 34/65] target/arm: GICv5 cpuif: Implement ICC_IAFFIDR_EL1",
        "Date": "Fri, 27 Mar 2026 11:16:29 +0000",
        "Message-ID": "<20260327111700.795099-35-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::42f;\n envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 CPU system register ICC_IAFFIDR_EL1 is a read-only register that\ntells the guest what the affinity ID of that CPU is.\n\nImplement this register.  In real hardware using the stream protocol,\nthe IRS tells the CPU its IAFFID using a DownstreamControl command as\npart of the handshake process when the IRS-CPU link is brought\nonline.  Our analogue of this is to pass the IAFFID as an extra\nargument to gicv5_set_gicv5state().  (We could have the CPU call into\nthe GIC every time to ask for the value, but this would mean we had\nto search the cpus[] array for the right CPU to return its IAFFID.)\n\nNote that we don't put the IAFFID into the gicv5_cpuif sub-struct,\nbecause that part of the CPU struct is zeroed on reset, and we must\nkeep the IAFFID across reset (we only set it up when the GIC device\nis created).\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         |  5 +++--\n include/hw/intc/arm_gicv5_stream.h |  3 ++-\n target/arm/cpu.c                   |  5 +++--\n target/arm/cpu.h                   |  2 ++\n target/arm/tcg/gicv5-cpuif.c       | 11 +++++++++++\n 5 files changed, 21 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c\nindex 5510e6239a..0b5303f370 100644\n--- a/hw/intc/arm_gicv5_common.c\n+++ b/hw/intc/arm_gicv5_common.c\n@@ -175,9 +175,10 @@ static void gicv5_common_realize(DeviceState *dev, Error **errp)\n     }\n \n     for (int i = 0; i < cs->num_cpus; i++) {\n-        if (!gicv5_set_gicv5state(cs->cpus[i], cs)) {\n+        if (!gicv5_set_gicv5state(cs->cpus[i], cs, cs->cpu_iaffids[i])) {\n             error_setg(errp,\n-                       \"CPU %d does not implement GICv5 CPU interface\", i);\n+                       \"CPU %d (IAFFID 0x%x) does not implement GICv5 CPU interface\",\n+                       i, cs->cpu_iaffids[i]);\n             return;\n         }\n     }\ndiff --git a/include/hw/intc/arm_gicv5_stream.h b/include/hw/intc/arm_gicv5_stream.h\nindex 670423fdad..136b6339ee 100644\n--- a/include/hw/intc/arm_gicv5_stream.h\n+++ b/include/hw/intc/arm_gicv5_stream.h\n@@ -20,6 +20,7 @@ typedef struct GICv5Common GICv5Common;\n  * gicv5_set_gicv5state\n  * @cpu: CPU object to tell about its IRS\n  * @cs: the GIC IRS it is connected to\n+ * @iaffid: the IAFFID of this CPU\n  *\n  * Set the CPU object's GICv5 pointer to point to this GIC IRS.  The\n  * IRS must call this when it is realized, for each CPU it is\n@@ -28,7 +29,7 @@ typedef struct GICv5Common GICv5Common;\n  * Returns true on success, false if the CPU doesn't implement the\n  * GICv5 CPU interface.\n  */\n-bool gicv5_set_gicv5state(ARMCPU *cpu, GICv5Common *cs);\n+bool gicv5_set_gicv5state(ARMCPU *cpu, GICv5Common *cs, uint32_t iaffid);\n \n /*\n  * The architected Stream Protocol is asynchronous; commands can be\ndiff --git a/target/arm/cpu.c b/target/arm/cpu.c\nindex 4044bce5b6..ceb303a55a 100644\n--- a/target/arm/cpu.c\n+++ b/target/arm/cpu.c\n@@ -1087,16 +1087,17 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags)\n }\n \n #ifndef CONFIG_USER_ONLY\n-bool gicv5_set_gicv5state(ARMCPU *cpu, GICv5Common *cs)\n+bool gicv5_set_gicv5state(ARMCPU *cpu, GICv5Common *cs, uint32_t iaffid)\n {\n     /*\n      * Set this CPU's gicv5state pointer to point to the GIC that we are\n-     * connected to.\n+     * connected to, and record our IAFFID.\n      */\n     if (!cpu_isar_feature(aa64_gcie, cpu)) {\n         return false;\n     }\n     cpu->env.gicv5state = cs;\n+    cpu->env.gicv5_iaffid = iaffid;\n     return true;\n }\n #endif\ndiff --git a/target/arm/cpu.h b/target/arm/cpu.h\nindex 1fdfd91ba4..a32c5f3ab1 100644\n--- a/target/arm/cpu.h\n+++ b/target/arm/cpu.h\n@@ -819,6 +819,8 @@ typedef struct CPUArchState {\n     void *gicv3state;\n     /* Similarly, for a GICv5Common */\n     void *gicv5state;\n+    /* For GICv5, this CPU's IAFFID */\n+    uint64_t gicv5_iaffid;\n #else /* CONFIG_USER_ONLY */\n     /* For usermode syscall translation.  */\n     bool eabi;\ndiff --git a/target/arm/tcg/gicv5-cpuif.c b/target/arm/tcg/gicv5-cpuif.c\nindex 8cf09791c1..005e2fa8d2 100644\n--- a/target/arm/tcg/gicv5-cpuif.c\n+++ b/target/arm/tcg/gicv5-cpuif.c\n@@ -226,6 +226,17 @@ static const ARMCPRegInfo gicv5_cpuif_reginfo[] = {\n         .fieldoffset = offsetof(CPUARMState, gicv5_cpuif.icc_icsr_el1),\n         .resetvalue = 0,\n     },\n+    {   .name = \"ICC_IAFFIDR_EL1\", .state = ARM_CP_STATE_AA64,\n+        .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 10, .opc2 = 5,\n+        .access = PL1_R, .type = ARM_CP_NO_RAW,\n+        /* ICC_IAFFIDR_EL1 holds the IAFFID only, in its low bits */\n+        .fieldoffset = offsetof(CPUARMState, gicv5_iaffid),\n+        /*\n+         * The field is a constant value set in gicv5_set_gicv5state(),\n+         * so don't allow it to be overwritten by reset.\n+         */\n+        .resetfn = arm_cp_reset_ignore,\n+    },\n };\n \n void define_gicv5_cpuif_regs(ARMCPU *cpu)\n",
    "prefixes": [
        "v2",
        "34/65"
    ]
}