From nobody Thu Nov 6 18:22:55 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 1542275723003450.6817929868773; Thu, 15 Nov 2018 01:55:23 -0800 (PST) Received: from localhost ([::1]:37724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNEMr-00008a-LD for importer@patchew.org; Thu, 15 Nov 2018 04:55:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNEAo-0007Rw-SG for qemu-devel@nongnu.org; Thu, 15 Nov 2018 04:42:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNEAn-0004oj-Vi for qemu-devel@nongnu.org; Thu, 15 Nov 2018 04:42:54 -0500 Received: from greensocs.com ([193.104.36.180]:41904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNEAk-0004NP-49; Thu, 15 Nov 2018 04:42:50 -0500 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id BA45C44325B; Thu, 15 Nov 2018 10:42:20 +0100 (CET) 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 VpKE5Dt3e3f5; Thu, 15 Nov 2018 10:42:19 +0100 (CET) Received: by greensocs.com (Postfix, from userid 998) id CF83F446876; Thu, 15 Nov 2018 10:42:19 +0100 (CET) Received: from michell-laptop.hive.antfield.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 5C2BC441B57; Thu, 15 Nov 2018 10:42:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1542274940; bh=Dkji4JTfOdePjfk92E+wL5e2vsn+se5ApMpIQQk9dpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fhqipl6MXaULk1MfmS37Pg5sVXuKicOLiowChTpqKyJQAYxLAHagKCpQlKA8by76A 30IGygdw4P0Oq+Q5u5pwEffZcVRRG9xfv4N79rnh58uAZpfqG8KS1PoF3I0XB1puP8 WWMNIp3oA9BhOG4xfsUXx3bDdvMzBICRhlWQnaMQ= 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=rgBeLN2t; dkim=pass (1024-bit key) header.d=greensocs.com header.b=rgBeLN2t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1542274939; bh=Dkji4JTfOdePjfk92E+wL5e2vsn+se5ApMpIQQk9dpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rgBeLN2tgEAcQ3JvVwPIf59Y9zYwGJDNCRichPiNH1vYH+ZEAGd5LZQCJTHy4IWeK j4yJK6ivKRY7OheLD1o6qL+4Eyb2/NCk0pzPZ0NafKeN9BQnzjYuWNFs0Q4CGL/HGk CTLgRCj4fqno0BOKT1DZZv7A4Dhr6nbtgjlfDMYU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1542274939; bh=Dkji4JTfOdePjfk92E+wL5e2vsn+se5ApMpIQQk9dpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rgBeLN2tgEAcQ3JvVwPIf59Y9zYwGJDNCRichPiNH1vYH+ZEAGd5LZQCJTHy4IWeK j4yJK6ivKRY7OheLD1o6qL+4Eyb2/NCk0pzPZ0NafKeN9BQnzjYuWNFs0Q4CGL/HGk CTLgRCj4fqno0BOKT1DZZv7A4Dhr6nbtgjlfDMYU= From: Luc Michel To: qemu-devel@nongnu.org Date: Thu, 15 Nov 2018 10:42:07 +0100 Message-Id: <20181115094207.22846-17-luc.michel@greensocs.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115094207.22846-1-luc.michel@greensocs.com> References: <20181115094207.22846-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 v6 16/16] arm/xlnx-zynqmp: put APUs and RPUs in separate 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 2 invalid signatures) Content-Type: text/plain; charset="utf-8" Create two separate CPU clusters for APUs and RPUs. Signed-off-by: Luc Michel Reviewed-by: Edgar E. Iglesias --- include/hw/arm/xlnx-zynqmp.h | 3 +++ hw/arm/xlnx-zynqmp.c | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 98f925ab84..591515c760 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -29,10 +29,11 @@ #include "hw/dma/xlnx_dpdma.h" #include "hw/dma/xlnx-zdma.h" #include "hw/display/xlnx_dp.h" #include "hw/intc/xlnx-zynqmp-ipi.h" #include "hw/timer/xlnx-zynqmp-rtc.h" +#include "hw/cpu/cluster.h" =20 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp" #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \ TYPE_XLNX_ZYNQMP) =20 @@ -75,10 +76,12 @@ typedef struct XlnxZynqMPState { /*< private >*/ DeviceState parent_obj; =20 /*< public >*/ + CPUClusterState apu_cluster; + CPUClusterState rpu_cluster; ARMCPU apu_cpu[XLNX_ZYNQMP_NUM_APU_CPUS]; ARMCPU rpu_cpu[XLNX_ZYNQMP_NUM_RPU_CPUS]; GICState gic; MemoryRegion gic_mr[XLNX_ZYNQMP_GIC_REGIONS][XLNX_ZYNQMP_GIC_ALIASES]; =20 diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index c195040350..42a138074c 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -176,16 +176,22 @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s= , const char *boot_cpu, { Error *err =3D NULL; int i; int num_rpus =3D MIN(smp_cpus - XLNX_ZYNQMP_NUM_APU_CPUS, XLNX_ZYNQMP_= NUM_RPU_CPUS); =20 + object_initialize_child(OBJECT(s), "rpu-cluster", &s->rpu_cluster, + sizeof(s->rpu_cluster), TYPE_CPU_CLUSTER, + &error_abort, NULL); + + qdev_init_nofail(DEVICE(&s->rpu_cluster)); + for (i =3D 0; i < num_rpus; i++) { char *name; =20 object_initialize(&s->rpu_cpu[i], sizeof(s->rpu_cpu[i]), "cortex-r5f-" TYPE_ARM_CPU); - object_property_add_child(OBJECT(s), "rpu-cpu[*]", + object_property_add_child(OBJECT(&s->rpu_cluster), "rpu-cpu[*]", OBJECT(&s->rpu_cpu[i]), &error_abort); =20 name =3D object_get_canonical_path_component(OBJECT(&s->rpu_cpu[i]= )); if (strcmp(name, boot_cpu)) { /* Secondary CPUs start in PSCI powered-down state */ @@ -211,14 +217,19 @@ static void xlnx_zynqmp_init(Object *obj) { XlnxZynqMPState *s =3D XLNX_ZYNQMP(obj); int i; int num_apus =3D MIN(smp_cpus, XLNX_ZYNQMP_NUM_APU_CPUS); =20 + object_initialize_child(obj, "apu-cluster", &s->apu_cluster, + sizeof(s->apu_cluster), TYPE_CPU_CLUSTER, + &error_abort, NULL); + for (i =3D 0; i < num_apus; i++) { - object_initialize_child(obj, "apu-cpu[*]", &s->apu_cpu[i], - sizeof(s->apu_cpu[i]), - "cortex-a53-" TYPE_ARM_CPU, &error_abort, = NULL); + object_initialize_child(OBJECT(&s->apu_cluster), "apu-cpu[*]", + &s->apu_cpu[i], sizeof(s->apu_cpu[i]), + "cortex-a53-" TYPE_ARM_CPU, &error_abort, + NULL); } =20 sysbus_init_child_obj(obj, "gic", &s->gic, sizeof(s->gic), gic_class_name()); =20 @@ -331,10 +342,12 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Err= or **errp) qdev_prop_set_uint32(DEVICE(&s->gic), "num-cpu", num_apus); qdev_prop_set_bit(DEVICE(&s->gic), "has-security-extensions", s->secur= e); qdev_prop_set_bit(DEVICE(&s->gic), "has-virtualization-extensions", s->virt); =20 + qdev_init_nofail(DEVICE(&s->apu_cluster)); + /* Realize APUs before realizing the GIC. KVM requires this. */ for (i =3D 0; i < num_apus; i++) { char *name; =20 object_property_set_int(OBJECT(&s->apu_cpu[i]), QEMU_PSCI_CONDUIT_= SMC, --=20 2.19.1