From nobody Thu Nov 6 10:35:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540543390935669.4411966854711; Fri, 26 Oct 2018 01:43:10 -0700 (PDT) Received: from localhost ([::1]:58879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFxi1-0007RU-5Y for importer@patchew.org; Fri, 26 Oct 2018 04:43:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFxUF-0000gN-W9 for qemu-devel@nongnu.org; Fri, 26 Oct 2018 04:28:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFxJE-0004pt-Lq for qemu-devel@nongnu.org; Fri, 26 Oct 2018 04:17:34 -0400 Received: from greensocs.com ([193.104.36.180]:45399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFxJ9-0004lQ-Jm; Fri, 26 Oct 2018 04:17:29 -0400 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id 135B9441B51; Fri, 26 Oct 2018 10:17:18 +0200 (CEST) Received: from greensocs.com ([127.0.0.1]) by localhost (gs-01.greensocs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4dOj2i8Wkzhi; Fri, 26 Oct 2018 10:17:12 +0200 (CEST) Received: by greensocs.com (Postfix, from userid 998) id 06B44441B44; Fri, 26 Oct 2018 10:17:11 +0200 (CEST) Received: from michell-laptop.home.lmichel.fr (lfbn-1-8165-82.w90-112.abo.wanadoo.fr [90.112.74.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: luc.michel@greensocs.com) by greensocs.com (Postfix) with ESMTPSA id 97110441B41; Fri, 26 Oct 2018 10:17:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1540541838; bh=FPZyVC5tVv7WdxRkgpQY4rs7Qz562EN5IzYD1va8ctA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VCXgaPL6J26K7DWcPgz3zrwUzWftlUIfLVrm2lrRniGthevfZTh4Cv9B0b8fyhpSL 8sRHNzhpIJyhXRnGkxQV9P4tyRihnFPxq0XKbonD6uAVVqLkR2eCcJVGRlK2rFmDC5 1loqC0IzoXQ6bPMlxvn58mdfXQHbvexKSGfVwaN8= X-Virus-Scanned: amavisd-new at greensocs.com Authentication-Results: gs-01.greensocs.com (amavisd-new); dkim=pass (1024-bit key) header.d=greensocs.com header.b=v2chrusj; dkim=pass (1024-bit key) header.d=greensocs.com header.b=2Zz+F0Y4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1540541832; bh=FPZyVC5tVv7WdxRkgpQY4rs7Qz562EN5IzYD1va8ctA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v2chrusjq7+j20MYPahLseoT0uO21jAmycZnqy4KmyaqkvX7zrTCUnGH+uKJH7FA/ s3ZELv7t7hoxqYQaAm/T66ngby4A3SBDq8GGpzx5SsEa6qkTcYzD29Wbd6Q8DEomgw ICLroHqmHNkyvrGwgRrzok7MnUXcfVBNqbfAQ9Hc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1540541831; bh=FPZyVC5tVv7WdxRkgpQY4rs7Qz562EN5IzYD1va8ctA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2Zz+F0Y4DKzjR4bR9uWKkKkEyIEL+N3BIahz/3TaH1iYyDpBLo0oiZqaE6HrSZe/B Avl+yqAbo/Wp6oaY9k30kD7glUMrX6GxFHl8RZmI3DTkNRyCeaC0unpmP3rZb2YoAU 9ia++TLqNJujMj+IwNmFf13G2oYQXxspioiIHW64= From: Luc Michel To: qemu-devel@nongnu.org Date: Fri, 26 Oct 2018 10:16:38 +0200 Message-Id: <20181026081653.24602-2-luc.michel@greensocs.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181026081653.24602-1-luc.michel@greensocs.com> References: <20181026081653.24602-1-luc.michel@greensocs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 193.104.36.180 Subject: [Qemu-devel] [PATCH v3 01/16] hw/cpu: introduce CPU clusters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , alistair@alistair23.me, mark.burton@greensocs.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , saipava@xilinx.com, edgari@xilinx.com, qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 3 invalid signatures) Content-Type: text/plain; charset="utf-8" This commit adds the cpu-cluster type. It aims at gathering CPUs from the same cluster in a machine. For now it only has a `cluster-id` property. Signed-off-by: Luc Michel Reviewed-by: Alistair Francis --- include/hw/cpu/cluster.h | 38 +++++++++++++++++++++++++++++++ hw/cpu/cluster.c | 49 ++++++++++++++++++++++++++++++++++++++++ hw/cpu/Makefile.objs | 2 +- 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 include/hw/cpu/cluster.h create mode 100644 hw/cpu/cluster.c diff --git a/include/hw/cpu/cluster.h b/include/hw/cpu/cluster.h new file mode 100644 index 0000000000..f233a47a4a --- /dev/null +++ b/include/hw/cpu/cluster.h @@ -0,0 +1,38 @@ +/* + * QEMU CPU cluster + * + * Copyright (c) 2018 GreenSocs SAS + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see + * + */ +#ifndef QEMU_HW_CPU_CLUSTER_H +#define QEMU_HW_CPU_CLUSTER_H + +#include "qemu/osdep.h" +#include "hw/qdev.h" + +#define TYPE_CPU_CLUSTER "cpu-cluster" +#define CPU_CLUSTER(obj) \ + OBJECT_CHECK(CPUClusterState, (obj), TYPE_CPU_CLUSTER) + +typedef struct CPUClusterState { + /*< private >*/ + DeviceState parent_obj; + + /*< public >*/ + uint32_t cluster_id; +} CPUClusterState; + +#endif diff --git a/hw/cpu/cluster.c b/hw/cpu/cluster.c new file mode 100644 index 0000000000..11121e6f26 --- /dev/null +++ b/hw/cpu/cluster.c @@ -0,0 +1,49 @@ +/* + * QEMU CPU cluster + * + * Copyright (c) 2018 GreenSocs SAS + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see + * + */ + +#include "hw/cpu/cluster.h" +#include "qapi/error.h" +#include "qemu/module.h" + +static Property cpu_cluster_properties[] =3D { + DEFINE_PROP_UINT32("cluster-id", CPUClusterState, cluster_id, 0), + DEFINE_PROP_END_OF_LIST() +}; + +static void cpu_cluster_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->props =3D cpu_cluster_properties; +} + +static const TypeInfo cpu_cluster_type_info =3D { + .name =3D TYPE_CPU_CLUSTER, + .parent =3D TYPE_DEVICE, + .instance_size =3D sizeof(CPUClusterState), + .class_init =3D cpu_cluster_class_init, +}; + +static void cpu_cluster_register_types(void) +{ + type_register_static(&cpu_cluster_type_info); +} + +type_init(cpu_cluster_register_types) diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs index cd52d20b65..8db9e8a7b3 100644 --- a/hw/cpu/Makefile.objs +++ b/hw/cpu/Makefile.objs @@ -1,5 +1,5 @@ obj-$(CONFIG_ARM11MPCORE) +=3D arm11mpcore.o obj-$(CONFIG_REALVIEW) +=3D realview_mpcore.o obj-$(CONFIG_A9MPCORE) +=3D a9mpcore.o obj-$(CONFIG_A15MPCORE) +=3D a15mpcore.o -common-obj-y +=3D core.o +common-obj-y +=3D core.o cluster.o --=20 2.19.1