From nobody Tue Feb 10 03:39:24 2026 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 1504867559361191.19643223490505; Fri, 8 Sep 2017 03:45:59 -0700 (PDT) Received: from localhost ([::1]:44494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqGnN-0002dw-Vv for importer@patchew.org; Fri, 08 Sep 2017 06:45:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqGe4-000280-JX for qemu-devel@nongnu.org; Fri, 08 Sep 2017 06:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqGdz-0003De-SI for qemu-devel@nongnu.org; Fri, 08 Sep 2017 06:36:20 -0400 Received: from ozlabs.org ([103.22.144.67]:57957) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqGdz-0003BN-Gi; Fri, 08 Sep 2017 06:36:15 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3xpYdK3jZcz9t4b; Fri, 8 Sep 2017 20:36:04 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1504866965; bh=dEXoKjuj8k7MH4w4ui8rCjPCkzJaQUEnQS04UcEjkvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dh9BYcY3gBGcDtgzHy/5JiId8RkNWA2pPsxHiIkcdKi3zrTUNFAlDIxOd1hLMPBZt /PjuVOo6ll73URNCZFTFRf019vGdttkIskwqmjB/LNR3+VjP+VXOwhkFhZk5rdiZ/P 0DRHMr/hRUqG82AgsUT+Xgq5JtID4eKPvcpNt9L4= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 8 Sep 2017 20:35:32 +1000 Message-Id: <20170908103558.31632-15-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170908103558.31632-1-david@gibson.dropbear.id.au> References: <20170908103558.31632-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 14/40] e500: Use cpu_index instead of vcpu_dt_id 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: qemu-devel@nongnu.org, aik@ozlabs.ru, agraf@suse.de, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, imammedo@redhat.com, sam.bobroff@au1.ibm.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Sam Bobroff The e500 platform code uses the function ppc_get_vcpu_dt_id() to get an id to put in its device tree. Which seems like it makes sense, but ppc_get_vcpu_dt_id() is actually badly named - it only differs from cpu_index in cases where you're running on KVM HV and the host's number of threads differs from the guests. Since KVM HV only supports PAPR, not e500, it doesn't make sense to use it here. Simply use the cpu_index instead (which is 'i' in this context because qemu_get_cpu(i) returns the cpu with cpu_index =3D=3D i). Signed-off-by: Sam Bobroff Reviewed-by: Greg Kurz [dwg: Rewrote commit message] Signed-off-by: David Gibson --- hw/ppc/e500.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index f0596f34ff..55cad780f4 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -382,7 +382,6 @@ static int ppce500_load_device_tree(MachineState *machi= ne, the first node as boot node and be happy */ for (i =3D smp_cpus - 1; i >=3D 0; i--) { CPUState *cpu; - PowerPCCPU *pcpu; char cpu_name[128]; uint64_t cpu_release_addr =3D params->spin_base + (i * 0x20); =20 @@ -391,16 +390,13 @@ static int ppce500_load_device_tree(MachineState *mac= hine, continue; } env =3D cpu->env_ptr; - pcpu =3D POWERPC_CPU(cpu); =20 - snprintf(cpu_name, sizeof(cpu_name), "/cpus/PowerPC,8544@%x", - ppc_get_vcpu_dt_id(pcpu)); + snprintf(cpu_name, sizeof(cpu_name), "/cpus/PowerPC,8544@%x", i); qemu_fdt_add_subnode(fdt, cpu_name); qemu_fdt_setprop_cell(fdt, cpu_name, "clock-frequency", clock_freq= ); qemu_fdt_setprop_cell(fdt, cpu_name, "timebase-frequency", tb_freq= ); qemu_fdt_setprop_string(fdt, cpu_name, "device_type", "cpu"); - qemu_fdt_setprop_cell(fdt, cpu_name, "reg", - ppc_get_vcpu_dt_id(pcpu)); + qemu_fdt_setprop_cell(fdt, cpu_name, "reg", i); qemu_fdt_setprop_cell(fdt, cpu_name, "d-cache-line-size", env->dcache_line_size); qemu_fdt_setprop_cell(fdt, cpu_name, "i-cache-line-size", --=20 2.13.5