From nobody Sat Sep 28 22:37:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548701315915654.0856569942947; Mon, 28 Jan 2019 10:48:35 -0800 (PST) Received: from localhost ([127.0.0.1]:36941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBxN-0008F0-Ux for importer@patchew.org; Mon, 28 Jan 2019 13:48:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goBNU-00031O-EA for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:11:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goBNQ-0000Pq-5v for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:11:24 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:39006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1goBNJ-0000Ez-94 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:11:15 -0500 Received: by mail-wr1-x444.google.com with SMTP id t27so19148906wra.6 for ; Mon, 28 Jan 2019 10:11:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id b18sm97910681wrw.83.2019.01.28.10.11.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 10:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=1LYeV/7A19n/oOAfWvaA7HfPSjT1wTZDwCl9XfLG4wQ=; b=k2O7Fk5CFRyJctPdGU4Hn9Msvr+VMICn6mNeHP9m5MiXEPj+f0Ic2EpPp6wUTN5iB3 Wuhgo0WTUjeTty8QAbvSv7RmCbCScW33+wmN7YydeCv/LswPiBqSbACL/WBO7etYrz7z h2+rrl0QV9PsoE/hUW/BT9tskzxQEHn/SH8NU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1LYeV/7A19n/oOAfWvaA7HfPSjT1wTZDwCl9XfLG4wQ=; b=A9sGPA+WP3zHqveOptGBUdE6ANrMKqulGgNJ4c7TXFvghxIZcW9NLsVMvhRYiQBVRU Mpgr2BX6ftyGihOewNAMzlc5peKHmaEIznoX5GkDMmvwCcdiSCfd/erK5YVrnvwzYVI+ VAHHk5Ss1Nu6lhMeMr6U90pD19kTGCaRMG33RZ9LupFOorzemZus+oFZGyW0w0MLhfez kUJxaxtFD0Byijnj3DjPRaFbUuDyYclHcCeHHV25IYHCgLVXT6WzK52xQsUwkyK0x7y+ OIiHjfOa6Ms4HBsc8KHIrPuDNyDewdz3b242PztYSQn6NU/ul6K9dxp/odu+5FLDS23U p/eA== X-Gm-Message-State: AJcUuke9gVQD7IbLBCcAcn/d6LkE2fw/jd4oSSV8uteaIl/jOSZCL5UW K0akZFxFTH/SMCXp0AUHSF1osZRhm3Sz1A== X-Google-Smtp-Source: ALg8bN4tsMv1hjmdo2MgxVpNzvHnl0r3Pxi/vT4lXTtidPUBXLXQKJkma+zAp6jxu+LmeO+YPF4cvQ== X-Received: by 2002:adf:9dd2:: with SMTP id q18mr22610177wre.12.1548699071445; Mon, 28 Jan 2019 10:11:11 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 18:10:38 +0000 Message-Id: <20190128181047.20781-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128181047.20781-1-peter.maydell@linaro.org> References: <20190128181047.20781-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PULL 17/26] xlnx-zynqmp: Don't create rpu-cluster if there are no RPUs 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If we aren't going to create any RPUs, then don't create the rpu-cluster unit. This allows us to add an assertion to the cluster object that it contains at least one CPU, which helps to avoid bugs in creating clusters and putting CPUs in them. Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20190121184314.14311-1-peter.maydell@linaro.org --- hw/arm/xlnx-zynqmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index c67ac2e64ac..70cbe6bd475 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -178,6 +178,11 @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s,= const char *boot_cpu, int i; int num_rpus =3D MIN(smp_cpus - XLNX_ZYNQMP_NUM_APU_CPUS, XLNX_ZYNQMP_= NUM_RPU_CPUS); =20 + if (num_rpus <=3D 0) { + /* Don't create rpu-cluster object if there's nothing to put in it= */ + return; + } + object_initialize_child(OBJECT(s), "rpu-cluster", &s->rpu_cluster, sizeof(s->rpu_cluster), TYPE_CPU_CLUSTER, &error_abort, NULL); --=20 2.20.1