Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2219338/?format=api
{ "id": 2219338, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2219338/?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": "<20260402215629.745866-7-ruslichenko.r@gmail.com>", "date": "2026-04-02T21:55:51", "name": "[v3,06/33] hw/core/fdt_generic: add cpu clusters management", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "784026876e5434310583149ea08abb569c9db50e", "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/20260402215629.745866-7-ruslichenko.r@gmail.com/mbox/", "series": [ { "id": 498555, "url": "http://patchwork.ozlabs.org/api/1.0/series/498555/?format=api", "date": "2026-04-02T21:55:47", "name": "hw/arm: Introduce generic FDT-driven machine", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/498555/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219338/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=20251104 header.b=Dz32pvxw;\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 4fmwhP4Zbpz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 08:57:57 +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 1w8Q24-0008Gm-P7; Thu, 02 Apr 2026 17:56:57 -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 <ruslichenko.r@gmail.com>)\n id 1w8Q23-0008G6-Fh\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 17:56:55 -0400", "from mail-ej1-x635.google.com ([2a00:1450:4864:20::635])\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 1w8Q21-00074N-Uq\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 17:56:55 -0400", "by mail-ej1-x635.google.com with SMTP id\n a640c23a62f3a-b982518b73fso207700166b.1\n for <qemu-devel@nongnu.org>; Thu, 02 Apr 2026 14:56:53 -0700 (PDT)", "from thinkpad-t470s.. (93-143-182-244.adsl.net.t-com.hr.\n [93.143.182.244]) by smtp.googlemail.com with ESMTPSA id\n a640c23a62f3a-b9c3cac0e1asm134009166b.27.2026.04.02.14.56.50\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 02 Apr 2026 14:56:51 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775167012; x=1775771812; 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=S9c0Pnh/0o6ZwLnjL42VohEGpoZWx1Y/0tXtC4CKsYA=;\n b=Dz32pvxwQNO3chVdb0X4trFzEVoauhIIPZPfFHhLvY+p+k+9mOIlXDovWe/vk3qW2z\n Jwlg4CJEnPKq+IQZaAs+YH1lpnnlnUUMy7lxxj6b1Msraad/WB+WFXje+QQKUlSrLFol\n 3jZ3vFHlAYD1piqB2DNucFJkdIxUGoNKwQ8ofb9lXQVygVHHzNsBrYWDX1R9VYogo4C4\n Zm+Xu/mY5bd5Cpxi36Q9qyA4hG7iT864BAgWh3oQewQyrEsRgPR4UqY3b4OTNkfGakFA\n zHenkWStIggLu7K4N3F5GqwOcb+bt6EqNzdCC5UH4DyCw817A0/BFyFvsbnAgNWgLzIp\n pX7g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775167012; x=1775771812;\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=S9c0Pnh/0o6ZwLnjL42VohEGpoZWx1Y/0tXtC4CKsYA=;\n b=geewbZUW6Y9AojGJcWFde6uvlfzaAxS5GhkWDLkJ+uflMWeZvoC63+m+5C//SufZhQ\n 6qakOh0Iho3NY3vmUgwLaXyfpGoi6AvS2kVWCoVyhSzryjME88BT/IJVmi3/3a5impjb\n nlM2ZRyxefUHyRQy3GijQRqxGRr602rBy3rwx3v5AnKXhL6z3p5770Ct0Gvs5kmVdwD1\n t8d5k49e1tSRxS2zwn56wJ6Km9bG8R5BtMUPQQ30j5XTvVKNyaWIMj/QdGQeEeJEx455\n 9Pwdr8bzKakgsSoW8dZ9BXnfUpTRMFoDHYxdZU/uRtbMBnuVsHvZQe0KZvXaEQ9Oe+xP\n uIDQ==", "X-Gm-Message-State": "AOJu0Yxms37cPclVc1Z+7NB5F3U7HEvmOTKAjBITovB+nPv4cSDYCxdN\n MPOVgEjSa9T2FG5ucGZzNHZlqmji30sl1dwuxaM6m4znG2ot5jVjzMWwW1tCaLtW", "X-Gm-Gg": "ATEYQzx1VSR1r0t4hzusdFTqzsjX2nYpr6wNpNPIEHs7IhJvRTAdz8ztqiAgpx3uBvv\n G68xNC4LUFxc3h0fuy3v6PPALNMfivI848pysBtGwaHiilgTgnS5ggEe4fm6xRb6AwOfOIzofBe\n qJBgv2ieST/ZeCvHs2w0wJwVCtLv+UR7ouK+pH9cVjBXAXCZa5hk0L7LACRxz0ZZhEClPYc9iiy\n tzOXLVnVDv+5Tf1YB4QPVD85P0S4Mxky4A6TQiYjNykYluY8BNCZ314iVUy4HNJoGTIBPbP3tJK\n 1cNXSfoAOeVXKG1rXst/9vFVzvEMMucntsGzhS6m6HQF0HFX/+dwjXg/qSRbOM4dzz+A14YLPQo\n 2/sYsdnRSr4yqKdcI2X6EaZTHRvhN8fYk2yRUYppCY14F3LiyN57N5JYvpLj11X83MOoeNLiT/9\n AAGb8VWtYDsEL83XmhGS280ZmBfFssaF+8BHVfBhDAGilGG8kDEjEgPlA5VuGrx5jQaziFLA==", "X-Received": "by 2002:a17:907:3e8a:b0:b99:7462:3c57 with SMTP id\n a640c23a62f3a-b9c6754ad85mr23744666b.14.1775167011775;\n Thu, 02 Apr 2026 14:56:51 -0700 (PDT)", "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 v3 06/33] hw/core/fdt_generic: add cpu clusters management", "Date": "Thu, 2 Apr 2026 23:55:51 +0200", "Message-ID": "<20260402215629.745866-7-ruslichenko.r@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260402215629.745866-1-ruslichenko.r@gmail.com>", "References": "<20260402215629.745866-1-ruslichenko.r@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::635;\n envelope-from=ruslichenko.r@gmail.com; helo=mail-ej1-x635.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\nAdd support for grouping CPUs into clusters during\nFDT machine instantiation.\n\nThe clusters are automatically created if CPU parent\nis not already an existing cluster.\n\nSigned-off-by: Ruslan Ruslichenko <Ruslan_Ruslichenko@epam.com>\n---\n hw/core/fdt_generic.c | 78 +++++++++++++++++++++++++++++++++++\n include/hw/core/fdt_generic.h | 13 ++++++\n 2 files changed, 91 insertions(+)", "diff": "diff --git a/hw/core/fdt_generic.c b/hw/core/fdt_generic.c\nindex da60de7a26..ded11cd6c0 100644\n--- a/hw/core/fdt_generic.c\n+++ b/hw/core/fdt_generic.c\n@@ -32,6 +32,7 @@\n #include \"migration/vmstate.h\"\n #include \"qemu/coroutine.h\"\n #include \"qemu/log.h\"\n+#include \"hw/cpu/cluster.h\"\n #include \"system/reset.h\"\n \n \n@@ -158,6 +159,76 @@ void *fdt_init_get_opaque(FDTMachineInfo *fdti, const char *node_path)\n return NULL;\n }\n \n+static int get_next_cpu_cluster_id(void)\n+{\n+ static int i;\n+\n+ return i++;\n+}\n+\n+void fdt_init_register_user_cpu_cluster(FDTMachineInfo *fdti, Object *cluster)\n+{\n+ int i = get_next_cpu_cluster_id();\n+ DeviceState *dev = DEVICE(cluster);\n+ FDTCPUCluster *cl;\n+\n+ qdev_prop_set_uint32(dev, \"cluster-id\", i);\n+\n+ cl = g_new0(FDTCPUCluster, 1);\n+ cl->cpu_cluster = cluster;\n+ cl->next = fdti->clusters;\n+ cl->user = true;\n+\n+ fdti->clusters = cl;\n+\n+ qemu_log_mask(LOG_FDT,\n+ \"%s: Registered user-defined cpu cluster with id %d\\n\",\n+ object_get_canonical_path(cluster), i);\n+}\n+\n+static void *fdt_init_add_cpu_cluster(FDTMachineInfo *fdti, char *compat)\n+{\n+ FDTCPUCluster *cl = g_malloc0(sizeof(*cl));\n+ int i = get_next_cpu_cluster_id();\n+ char *name = g_strdup_printf(\"cluster%d\", i);\n+ Object *obj;\n+\n+ obj = object_new(TYPE_CPU_CLUSTER);\n+ object_property_add_child(object_get_root(), name, OBJECT(obj));\n+ qdev_prop_set_uint32(DEVICE(obj), \"cluster-id\", i);\n+\n+ cl->cpu_type = g_strdup(compat);\n+ cl->cpu_cluster = obj;\n+ cl->next = fdti->clusters;\n+\n+ fdti->clusters = cl;\n+\n+ g_free(name);\n+\n+ return obj;\n+}\n+\n+void *fdt_init_get_cpu_cluster(FDTMachineInfo *fdti, Object *parent,\n+ char *compat)\n+{\n+ FDTCPUCluster *cl = fdti->clusters;\n+\n+ if (object_dynamic_cast(parent, TYPE_CPU_CLUSTER)) {\n+ /* The direct parent of this CPU is a CPU cluster. Use it. */\n+ return parent;\n+ }\n+\n+ while (cl) {\n+ if (!cl->user && !strcmp(compat, cl->cpu_type)) {\n+ return cl->cpu_cluster;\n+ }\n+ cl = cl->next;\n+ }\n+\n+ /* No cluster found so create and return a new one */\n+ return fdt_init_add_cpu_cluster(fdti, compat);\n+}\n+\n FDTMachineInfo *fdt_init_new_fdti(void *fdt)\n {\n FDTMachineInfo *fdti = g_malloc0(sizeof(*fdti));\n@@ -171,8 +242,15 @@ FDTMachineInfo *fdt_init_new_fdti(void *fdt)\n \n void fdt_init_destroy_fdti(FDTMachineInfo *fdti)\n {\n+ FDTCPUCluster *cl = fdti->clusters;\n FDTDevOpaque *dp;\n \n+ while (cl) {\n+ FDTCPUCluster *tmp = cl;\n+ cl = cl->next;\n+ g_free(tmp->cpu_type);\n+ g_free(tmp);\n+ }\n for (dp = fdti->dev_opaques; dp->node_path; dp++) {\n g_free(dp->node_path);\n }\ndiff --git a/include/hw/core/fdt_generic.h b/include/hw/core/fdt_generic.h\nindex d204ceda43..05ab07e08c 100644\n--- a/include/hw/core/fdt_generic.h\n+++ b/include/hw/core/fdt_generic.h\n@@ -18,6 +18,13 @@ typedef struct FDTDevOpaque {\n void *opaque;\n } FDTDevOpaque;\n \n+typedef struct FDTCPUCluster {\n+ char *cpu_type;\n+ void *cpu_cluster;\n+ void *next;\n+ bool user;\n+} FDTCPUCluster;\n+\n typedef struct FDTMachineInfo {\n /* the fdt blob */\n void *fdt;\n@@ -27,6 +34,8 @@ typedef struct FDTMachineInfo {\n FDTDevOpaque *dev_opaques;\n /* recheck coroutine queue */\n CoQueue *cq;\n+ /* list of all CPU clusters */\n+ FDTCPUCluster *clusters;\n } FDTMachineInfo;\n \n /*\n@@ -72,6 +81,10 @@ void fdt_init_set_opaque(FDTMachineInfo *fdti, const char *node_path,\n int fdt_init_has_opaque(FDTMachineInfo *fdti, const char *node_path);\n void *fdt_init_get_opaque(FDTMachineInfo *fdti, const char *node_path);\n \n+void *fdt_init_get_cpu_cluster(FDTMachineInfo *fdti, Object *parent,\n+ char *compat);\n+void fdt_init_register_user_cpu_cluster(FDTMachineInfo *fdti, Object *cluster);\n+\n /* statically register a FDTInitFn as being associate with a compatibility */\n \n #define fdt_register_compatibility_opaque(function, compat, n, opaque) \\\n", "prefixes": [ "v3", "06/33" ] }