From patchwork Thu Aug 3 06:28:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 9878203 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DDF0A603B4 for ; Thu, 3 Aug 2017 06:31:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBF3F28876 for ; Thu, 3 Aug 2017 06:31:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0EB128879; Thu, 3 Aug 2017 06:31:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DE6C28876 for ; Thu, 3 Aug 2017 06:31:39 +0000 (UTC) Received: from localhost ([::1]:40773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9fW-0006X0-P4 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 03 Aug 2017 02:31:38 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 == 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 *machine, the first node as boot node and be happy */ for (i = smp_cpus - 1; i >= 0; i--) { CPUState *cpu; - PowerPCCPU *pcpu; char cpu_name[128]; uint64_t cpu_release_addr = params->spin_base + (i * 0x20); @@ -391,16 +390,13 @@ static int ppce500_load_device_tree(MachineState *machine, continue; } env = cpu->env_ptr; - pcpu = POWERPC_CPU(cpu); - 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",