Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198216/?format=api
{ "id": 2198216, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198216/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/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": "<20260219144901.3317747-11-ruslichenko.r@gmail.com>", "date": "2026-02-19T14:48:57", "name": "[v2,29/33] hw/intc/arm_gicv3: Implement FDTGenericIntc interface", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6a8b95f8896028577944d7525f0d17c83734311a", "submitter": { "id": 92275, "url": "http://patchwork.ozlabs.org/api/1.0/people/92275/?format=api", "name": "Ruslan Ruslichenko", "email": "ruslichenko.r@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260219144901.3317747-11-ruslichenko.r@gmail.com/mbox/", "series": [ { "id": 492690, "url": "http://patchwork.ozlabs.org/api/1.0/series/492690/?format=api", "date": "2026-02-19T14:33:04", "name": "hw/arm: Introduce generic FDT-driven machine", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492690/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198216/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=JZp5ExZi;\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 4fGxCf0tymz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Feb 2026 01:51:26 +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 1vt5MN-000456-Vj; Thu, 19 Feb 2026 09:50:32 -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 <ruslichenko.r@gmail.com>)\n id 1vt5MC-0003uy-P5\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 09:50:22 -0500", "from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <ruslichenko.r@gmail.com>)\n id 1vt5M6-00085L-Eh\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 09:50:19 -0500", "by mail-wm1-x32f.google.com with SMTP id\n 5b1f17b1804b1-4836f363d0dso9434375e9.3\n for <qemu-devel@nongnu.org>; Thu, 19 Feb 2026 06:49:55 -0800 (PST)", "from thinkpad-t470s.. (93-143-129-182.adsl.net.t-com.hr.\n [93.143.129.182]) by smtp.googlemail.com with ESMTPSA id\n ffacd0b85a97d-43796ac8d82sm50163087f8f.31.2026.02.19.06.49.52\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 19 Feb 2026 06:49:53 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771512594; x=1772117394; 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=S8jISgrMRUU7GJEHRBKA1C6CwoQWVbq4rD3s2gB8p7Y=;\n b=JZp5ExZiWw+7p+F5STRP7lRL0TJz14IyH61HlyxfkGpB7G17aqv7DecrsBzpXNNJOo\n tTNiWyxQiyXh8DXk3a+t+man0mlKNx+5f+XFAVbY6faN1fmEuLvaK4LaENIRztAVjskF\n QyNfssUJbN9dgABIfJXpFt9P7eQk7CNs6QQWhiTx09hmttzEYx89ITGz8pI9rWeOq2Cq\n fRTTB9QxGETmXaMdLhg66M+UTN3e4BZH2e70F1EGN/4vytm9XCLp3kXRY7tU9Q99JurK\n awiU6PBhG20dH/Kast4FkQXDhnVqGasmnH17i1a3bANXj34czkX0RBUcvOogGHoJoOLD\n pijw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771512594; x=1772117394;\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=S8jISgrMRUU7GJEHRBKA1C6CwoQWVbq4rD3s2gB8p7Y=;\n b=DHI09ZnFnLd5qLUYOMshj9yJfGUBgT12+EMsUcQ9oowd1+g2OYzZSYYvenIeC+c7Y2\n g5MCpojYs0+hD2tcDgdnqFgVJ500B3GtF8NGKtMMdtuVT4d2YepI1TEzIZ7/y2Gj8Els\n Xu1wP9aXtr3bhYqAXM7j6PTsFEiky7qmiXjDwjt6yAAb4P2XhXYSOEyIxAO+qLP0+HCm\n ixSMEgYBATExp34X/XqaT348UvgSP2nmc+O2gI7iI7tE/oDKwKPZlSNUMEMDvBEiv3pp\n /dIz3Uaat/scLhvfB8wckqInsnv9AP92UCWmHNDqi4bFpbYHOn7priiHqERG0P5wdcCQ\n 3b3A==", "X-Gm-Message-State": "AOJu0YwuAJkR+mJfC+NB/NgXdXvano2YH99UV1FUQWkRJnk7/KPhS83W\n oUYc1sGKFgBqjCt2+2yFVahyUP/UA+fgDdGJjJj1z25O/YEpud1qEJlyXD5FpcMt", "X-Gm-Gg": "AZuq6aLVFOGhgO/9oLJ05QFNelaenZUxMw7ieWAKc+teAz1MzGO0+GeN23XCsJAfulR\n E4pFzrx1/tVlXO5y3YcmB9duCcha0NA43tm+2t091qUAVpE4os3O0x9k2CompU/rELzNnWtAOVu\n lMNb/YmstITFHvPJABMLHTBBNuzYfO1KUj60360sBGiCoKMfMdzIQWBxS2o5fV5Ikz8nvMKnIKI\n L81SjElw2BhhJZD0Djd976+CJpKmm4dPKSLO/GZpdJJb4reWtt//o8zCUyUT2ulj2fIctExGkCq\n unJtYm8yD8gbjT9XYKxBPxpdvOzaoW0tOJh7NN7xEgA/Z5zYZ5hPqYsGNmjAx4Uadz/gN2Gr/Xn\n t4kk8NSKn1qAyb6Bw1l03MM9shNh9NXfHVXXa8MxvfnDVagRX254xCqJRwb5cMJ7YYhBjWkoYQI\n GbG7jlc++mRrS+ftr4eubrqouqHzm8gMjiS7tUMkOp99on8UZT6ef2UMuPvoKZAW6sbhgT", "X-Received": "by 2002:a05:600c:1f92:b0:47d:25ac:3a94 with SMTP id\n 5b1f17b1804b1-48379bfd727mr298943275e9.17.1771512594118;\n Thu, 19 Feb 2026 06:49:54 -0800 (PST)", "From": "Ruslan Ruslichenko <ruslichenko.r@gmail.com>", "To": "qemu-devel@nongnu.org", "Cc": "qemu-arm@nongnu.org, alex.bennee@linaro.org, peter.maydell@linaro.org,\n artem_mygaiev@epam.com, volodymyr_babchuk@epam.com,\n takahiro.nakata.wr@renesas.com,\n \"Edgar E . Iglesias\" <edgar.iglesias@gmail.com>,\n Ruslan_Ruslichenko@epam.com, balaton@eik.bme.hu", "Subject": "[PATCH v2 29/33] hw/intc/arm_gicv3: Implement FDTGenericIntc\n interface", "Date": "Thu, 19 Feb 2026 15:48:57 +0100", "Message-ID": "<20260219144901.3317747-11-ruslichenko.r@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260219144901.3317747-1-ruslichenko.r@gmail.com>", "References": "<20260219143332.3316679-1-ruslichenko.r@gmail.com>\n <20260219144901.3317747-1-ruslichenko.r@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::32f;\n envelope-from=ruslichenko.r@gmail.com; helo=mail-wm1-x32f.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=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: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n\nThis patch implements the FDTGenericIntc interface for the\nARM GICv3 interrupt controller.\n\nThis enables the generic FDT machine infrastructure to\nautomatically wire up the GIC and resolve interrupts\ndefined in the Device Tree.\n\nSigned-off-by: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n---\n hw/intc/arm_gicv3.c | 45 +++++++++++++++++++++++++\n hw/intc/arm_gicv3_common.c | 68 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 113 insertions(+)", "diff": "diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c\nindex 542f81ea49..e7e98ef9a5 100644\n--- a/hw/intc/arm_gicv3.c\n+++ b/hw/intc/arm_gicv3.c\n@@ -18,9 +18,13 @@\n #include \"qemu/osdep.h\"\n #include \"qapi/error.h\"\n #include \"qemu/module.h\"\n+#include \"hw/core/cpu.h\"\n+#include \"hw/core/boards.h\"\n #include \"hw/intc/arm_gicv3.h\"\n #include \"gicv3_internal.h\"\n \n+#include \"hw/core/fdt_generic_util.h\"\n+\n static bool irqbetter(GICv3CPUState *cs, int irq, uint8_t prio, bool nmi)\n {\n /* Return true if this IRQ at this priority should take\n@@ -452,14 +456,55 @@ static void arm_gic_realize(DeviceState *dev, Error **errp)\n gicv3_init_cpuif(s);\n }\n \n+static void arm_gic_fdt_auto_parent(FDTGenericIntc *obj, Error **errp)\n+{\n+ GICv3State *s = ARM_GICV3(obj);\n+ SysBusDevice *sbd = SYS_BUS_DEVICE(obj);\n+ int num_cpus = s->num_cpu;\n+ CPUState *cs;\n+ int i = 0;\n+\n+ for (cs = first_cpu; cs; cs = CPU_NEXT(cs)) {\n+ if (i >= s->num_cpu) {\n+ break;\n+ }\n+\n+ sysbus_connect_irq(sbd, i,\n+ qdev_get_gpio_in(DEVICE(cs), 0));\n+ sysbus_connect_irq(sbd, i + num_cpus,\n+ qdev_get_gpio_in(DEVICE(cs), 1));\n+ sysbus_connect_irq(sbd, i + 2 * num_cpus,\n+ qdev_get_gpio_in(DEVICE(cs), 2));\n+ sysbus_connect_irq(sbd, i + 3 * num_cpus,\n+ qdev_get_gpio_in(DEVICE(cs), 3));\n+ sysbus_connect_irq(sbd, i + 4 * num_cpus,\n+ qdev_get_gpio_in(DEVICE(cs), 4));\n+ sysbus_connect_irq(sbd, i + 5 * num_cpus,\n+ qdev_get_gpio_in(DEVICE(cs), 5));\n+\n+ if (s->maint_irq) {\n+ int intbase = s->num_irq - GIC_INTERNAL + i * GIC_INTERNAL;\n+ qemu_irq irq = qdev_get_gpio_in(DEVICE(sbd),\n+ intbase + s->maint_irq);\n+ qdev_connect_gpio_out_named(DEVICE(cs),\n+ \"gicv3-maintenance-interrupt\",\n+ 0, irq);\n+ }\n+\n+ i++;\n+ }\n+}\n+\n static void arm_gicv3_class_init(ObjectClass *klass, const void *data)\n {\n DeviceClass *dc = DEVICE_CLASS(klass);\n ARMGICv3CommonClass *agcc = ARM_GICV3_COMMON_CLASS(klass);\n ARMGICv3Class *agc = ARM_GICV3_CLASS(klass);\n+ FDTGenericIntcClass *fgic = FDT_GENERIC_INTC_CLASS(klass);\n \n agcc->post_load = arm_gicv3_post_load;\n device_class_set_parent_realize(dc, arm_gic_realize, &agc->parent_realize);\n+ fgic->auto_parent = arm_gic_fdt_auto_parent;\n }\n \n static const TypeInfo arm_gicv3_info = {\ndiff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c\nindex 9200671c7a..a393540825 100644\n--- a/hw/intc/arm_gicv3_common.c\n+++ b/hw/intc/arm_gicv3_common.c\n@@ -34,6 +34,7 @@\n #include \"system/kvm.h\"\n #include \"system/whpx.h\"\n \n+#include \"hw/core/fdt_generic_util.h\"\n \n static void gicv3_gicd_no_migration_shift_bug_post_load(GICv3State *cs)\n {\n@@ -367,6 +368,69 @@ void gicv3_init_irqs_and_mmio(GICv3State *s, qemu_irq_handler handler,\n }\n }\n \n+#define FDT_GENERIC_GICV3_TYPE_AFFINITY_ALL 0x01000000U\n+#define FDT_GENERIC_GICV3_TYPE_AFFINITY_IDX 0x02000000U\n+\n+static int arm_gicv3_common_fdt_get_irq(FDTGenericIntc *obj, qemu_irq *irqs,\n+ uint32_t *cells, int ncells, int max,\n+ Error **errp)\n+{\n+ GICv3State *gs = ARM_GICV3_COMMON(obj);\n+ int cpu = 0;\n+ uint32_t qemu_type;\n+ uint32_t cpu_mask;\n+ uint32_t idx;\n+\n+ if (ncells != 3) {\n+ error_setg(errp, \"ARM GIC requires 3 interrupt cells, %d cells given\",\n+ ncells);\n+ return 0;\n+ }\n+ idx = cells[1];\n+ qemu_type = cells[0] & 0xff000000;\n+\n+ switch (cells[0] & 0x00ffffff) {\n+ case 0:\n+ if (idx >= gs->num_irq) {\n+ error_setg(errp, \"ARM GIC SPI has maximum index of %\" PRId32 \", \"\n+ \"index %\" PRId32 \" given\", gs->num_irq - 1, idx);\n+ return 0;\n+ }\n+ (*irqs) = qdev_get_gpio_in(DEVICE(obj), cells[1]);\n+ return 1;\n+ case 1: /* PPI */\n+ if (idx >= 16) {\n+ error_setg(errp, \"ARM GIC PPI has maximum index of 15, \"\n+ \"index %\" PRId32 \" given\", idx);\n+ return 0;\n+ }\n+ if (qemu_type == FDT_GENERIC_GICV3_TYPE_AFFINITY_IDX) {\n+ cpu = cells[2] >> 8;\n+ *irqs = qdev_get_gpio_in(DEVICE(obj),\n+ gs->num_irq - 16 + idx + cpu * 32);\n+ return cpu;\n+ }\n+\n+ cpu_mask = cells[2] >> 8;\n+ while ((cpu_mask || qemu_type == FDT_GENERIC_GICV3_TYPE_AFFINITY_ALL)\n+ && cpu < max && cpu < gs->num_cpu) {\n+ if ((cpu_mask & 1) ||\n+ qemu_type == FDT_GENERIC_GICV3_TYPE_AFFINITY_ALL) {\n+ *irqs = qdev_get_gpio_in(DEVICE(obj),\n+ gs->num_irq - 16 + idx + cpu * 32);\n+ irqs++;\n+ }\n+ cpu_mask >>= 1;\n+ cpu++;\n+ }\n+ return cpu;\n+ default:\n+ error_setg(errp, \"Invalid cell 0 value in interrupt binding: %d\",\n+ cells[0]);\n+ return 0;\n+ }\n+}\n+\n static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)\n {\n GICv3State *s = ARM_GICV3_COMMON(dev);\n@@ -624,12 +688,15 @@ static void arm_gicv3_common_class_init(ObjectClass *klass, const void *data)\n DeviceClass *dc = DEVICE_CLASS(klass);\n ResettableClass *rc = RESETTABLE_CLASS(klass);\n ARMLinuxBootIfClass *albifc = ARM_LINUX_BOOT_IF_CLASS(klass);\n+ FDTGenericIntcClass *fgic = FDT_GENERIC_INTC_CLASS(klass);\n+\n \n rc->phases.hold = arm_gicv3_common_reset_hold;\n dc->realize = arm_gicv3_common_realize;\n device_class_set_props(dc, arm_gicv3_common_properties);\n dc->vmsd = &vmstate_gicv3;\n albifc->arm_linux_init = arm_gic_common_linux_init;\n+ fgic->get_irq = arm_gicv3_common_fdt_get_irq;\n }\n \n static const TypeInfo arm_gicv3_common_type = {\n@@ -641,6 +708,7 @@ static const TypeInfo arm_gicv3_common_type = {\n .abstract = true,\n .interfaces = (const InterfaceInfo[]) {\n { TYPE_ARM_LINUX_BOOT_IF },\n+ { TYPE_FDT_GENERIC_INTC },\n { },\n },\n };\n", "prefixes": [ "v2", "29/33" ] }