From nobody Mon Feb 9 09:28:49 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; 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 1501741917390707.2950892356278; Wed, 2 Aug 2017 23:31:57 -0700 (PDT) Received: from localhost ([::1]:40833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9fn-0006y7-0i for importer@patchew.org; Thu, 03 Aug 2017 02:31:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9cm-00059I-49 for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd9cj-0007D6-4e for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54841 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dd9ci-0007CV-VA for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:45 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v736SfY0122247 for ; Thu, 3 Aug 2017 02:28:44 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2c3q2em672-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Aug 2017 02:28:43 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Aug 2017 16:28:41 +1000 Received: from d23relay09.au.ibm.com (202.81.31.228) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 Aug 2017 16:28:38 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v736ScQl23134308; Thu, 3 Aug 2017 16:28:38 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v736SSkU018210; Thu, 3 Aug 2017 16:28:29 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v736SSGs018204; Thu, 3 Aug 2017 16:28:28 +1000 Received: from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 6DBAAA0098; Thu, 3 Aug 2017 16:28:37 +1000 (AEST) Date: Thu, 3 Aug 2017 16:28:36 +1000 From: Sam Bobroff To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-TM-AS-MML: disable x-cbid: 17080306-0040-0000-0000-0000034C66CC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080306-0041-0000-0000-00000CC90038 Message-Id: <31205fa54bd9761aee5fb3a6724c98f7e9e86240.1501740002.git.sam.bobroff@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708030100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 2/4] 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: agraf@suse.de, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The e500 platform code uses the function ppc_get_vcpu_dt_id() but that function is actually specific to SPAPR machines, not PPC CPUs, and will always return the cpu_index in this context. 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 --- 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 62f1857206..2a6d34ceb1 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.12.1.382.gc0f9c7058