From nobody Mon Apr 29 16:08:59 2024 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 1501741816052119.61013160414768; Wed, 2 Aug 2017 23:30:16 -0700 (PDT) Received: from localhost ([::1]:40739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9e7-0005sd-UN for importer@patchew.org; Thu, 03 Aug 2017 02:30:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9ck-000593-9g for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd9ch-0007BX-5V for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54722 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 1dd9ch-0007Ao-0V for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:43 -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 v736SeAf122171 for ; Thu, 3 Aug 2017 02:28:42 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2c3q2em5y5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Aug 2017 02:28:42 -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:31 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) 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:29 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v736STsi18350240; Thu, 3 Aug 2017 16:28:29 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v736SJL3020957; Thu, 3 Aug 2017 16:28:19 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v736SJHb020953; Thu, 3 Aug 2017 16:28:19 +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 82478A0098; Thu, 3 Aug 2017 16:28:28 +1000 (AEST) Date: Thu, 3 Aug 2017 16:28:27 +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-0000034C66CA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080306-0041-0000-0000-00000CC90035 Message-Id: <4646e612ef5efb4f17f07eaec18e940f7ae93382.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 1/4] spapr: Fix bug in h_signal_sys_reset() 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 unicast case in h_signal_sys_reset() seems to be broken: rather than selecting the target CPU, it looks like it will pick either the first CPU or fail to find one at all. Fix it by using the search function rather than open coding the search. This was found by inspection; the code appears to be unused because the Linux kernel only uses the broadcast target. Signed-off-by: Sam Bobroff Reviewed-by: Greg Kurz --- hw/ppc/spapr_hcall.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 72ea5a8247..07b3da8dc4 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1431,11 +1431,10 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *= cpu, =20 } else { /* Unicast */ - CPU_FOREACH(cs) { - if (cpu->cpu_dt_id =3D=3D target) { - run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NU= LL); - return H_SUCCESS; - } + cs =3D CPU(ppc_get_vcpu_by_dt_id(target)); + if (cs) { + run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL); + return H_SUCCESS; } return H_PARAMETER; } --=20 2.12.1.382.gc0f9c7058 From nobody Mon Apr 29 16:08:59 2024 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 From nobody Mon Apr 29 16:08:59 2024 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 150174182682752.4501768687544; Wed, 2 Aug 2017 23:30:26 -0700 (PDT) Received: from localhost ([::1]:40752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9eJ-00062w-0h for importer@patchew.org; Thu, 03 Aug 2017 02:30:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9ct-0005G0-U5 for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd9cq-0007K9-Oc for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38971) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dd9cq-0007J4-ES for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:28:52 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v736Scln069713 for ; Thu, 3 Aug 2017 02:28:51 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 2c3x4v1jv0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Aug 2017 02:28:50 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Aug 2017 16:28:48 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 Aug 2017 16:28:46 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v736Skth18350252; Thu, 3 Aug 2017 16:28:46 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v736Sjct032089; Thu, 3 Aug 2017 16:28:45 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v736SjR4032083; Thu, 3 Aug 2017 16:28:45 +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 69C8CA0098; Thu, 3 Aug 2017 16:28:45 +1000 (AEST) Date: Thu, 3 Aug 2017 16:28:44 +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-0048-0000-0000-000002577B09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080306-0049-0000-0000-0000480A44E8 Message-Id: <5777ef503c5c7f43f21981ed11c90fb7579ccfae.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.156.1 Subject: [Qemu-devel] [PATCH 3/4] ppc: spapr: Rename cpu_dt_id to vcpu_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" This field actually records the VCPU ID used by KVM and, although the value is also used in the device tree it is primarily the VCPU ID so rename it as such. Signed-off-by: Sam Bobroff Reviewed-by: Greg Kurz --- hw/ppc/ppc.c | 8 ++++---- hw/ppc/spapr.c | 16 ++++++++-------- hw/ppc/spapr_hcall.c | 4 ++-- hw/ppc/spapr_rtas.c | 4 ++-- target/ppc/cpu.h | 14 +++++++------- target/ppc/kvm.c | 2 +- target/ppc/translate_init.c | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 224184d66d..4477d4ad89 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1359,19 +1359,19 @@ void PPC_debug_write (void *opaque, uint32_t addr, = uint32_t val) } =20 /* CPU device-tree ID helpers */ -int ppc_get_vcpu_dt_id(PowerPCCPU *cpu) +int ppc_get_vcpu_id(PowerPCCPU *cpu) { - return cpu->cpu_dt_id; + return cpu->vcpu_id; } =20 -PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id) +PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id) { CPUState *cs; =20 CPU_FOREACH(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); =20 - if (cpu->cpu_dt_id =3D=3D cpu_dt_id) { + if (cpu->vcpu_id =3D=3D vcpu_id) { return cpu; } } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f7a19720dc..83c77096a6 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -208,7 +208,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset= , PowerPCCPU *cpu, int i, ret =3D 0; uint32_t servers_prop[smt_threads]; uint32_t gservers_prop[smt_threads * 2]; - int index =3D ppc_get_vcpu_dt_id(cpu); + int index =3D ppc_get_vcpu_id(cpu); =20 if (cpu->compat_pvr) { ret =3D fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_p= vr); @@ -237,7 +237,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset= , PowerPCCPU *cpu, =20 static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu) { - int index =3D ppc_get_vcpu_dt_id(cpu); + int index =3D ppc_get_vcpu_id(cpu); uint32_t associativity[] =3D {cpu_to_be32(0x5), cpu_to_be32(0x0), cpu_to_be32(0x0), @@ -341,7 +341,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineSt= ate *spapr) PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - int index =3D ppc_get_vcpu_dt_id(cpu); + int index =3D ppc_get_vcpu_id(cpu); int compat_smt =3D MIN(smp_threads, ppc_compat_max_threads(cpu)); =20 if ((index % smt) !=3D 0) { @@ -493,7 +493,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *f= dt, int offset, PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cs); - int index =3D ppc_get_vcpu_dt_id(cpu); + int index =3D ppc_get_vcpu_id(cpu); uint32_t segs[] =3D {cpu_to_be32(28), cpu_to_be32(40), 0xffffffff, 0xffffffff}; uint32_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() @@ -626,7 +626,7 @@ static void spapr_populate_cpus_dt_node(void *fdt, sPAP= RMachineState *spapr) */ CPU_FOREACH_REVERSE(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - int index =3D ppc_get_vcpu_dt_id(cpu); + int index =3D ppc_get_vcpu_id(cpu); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); int offset; =20 @@ -2982,7 +2982,7 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState *= cs, int *fdt_offset, { PowerPCCPU *cpu =3D POWERPC_CPU(cs); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - int id =3D ppc_get_vcpu_dt_id(cpu); + int id =3D ppc_get_vcpu_id(cpu); void *fdt; int offset, fdt_size; char *nodename; @@ -3390,9 +3390,9 @@ static void spapr_ics_resend(XICSFabric *dev) ics_resend(spapr->ics); } =20 -static ICPState *spapr_icp_get(XICSFabric *xi, int cpu_dt_id) +static ICPState *spapr_icp_get(XICSFabric *xi, int vcpu_id) { - PowerPCCPU *cpu =3D ppc_get_vcpu_by_dt_id(cpu_dt_id); + PowerPCCPU *cpu =3D ppc_get_cpu_by_vcpu_id(vcpu_id); =20 return cpu ? ICP(cpu->intc) : NULL; } diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 07b3da8dc4..4ca233854a 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -999,7 +999,7 @@ static target_ulong h_register_vpa(PowerPCCPU *cpu, sPA= PRMachineState *spapr, CPUPPCState *tenv; PowerPCCPU *tcpu; =20 - tcpu =3D ppc_get_vcpu_by_dt_id(procno); + tcpu =3D ppc_get_cpu_by_vcpu_id(procno); if (!tcpu) { return H_PARAMETER; } @@ -1431,7 +1431,7 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cp= u, =20 } else { /* Unicast */ - cs =3D CPU(ppc_get_vcpu_by_dt_id(target)); + cs =3D CPU(ppc_get_cpu_by_vcpu_id(target)); if (cs) { run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL); return H_SUCCESS; diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 94a2799b99..626c06b375 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -104,7 +104,7 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cp= u_, } =20 id =3D rtas_ld(args, 0); - cpu =3D ppc_get_vcpu_by_dt_id(id); + cpu =3D ppc_get_cpu_by_vcpu_id(id); if (cpu !=3D NULL) { if (CPU(cpu)->halted) { rtas_st(rets, 1, 0); @@ -158,7 +158,7 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPRMachi= neState *spapr, start =3D rtas_ld(args, 1); r3 =3D rtas_ld(args, 2); =20 - cpu =3D ppc_get_vcpu_by_dt_id(id); + cpu =3D ppc_get_cpu_by_vcpu_id(id); if (cpu !=3D NULL) { CPUState *cs =3D CPU(cpu); CPUPPCState *env =3D &cpu->env; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 6ee2a26a96..89f05542c6 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1199,7 +1199,7 @@ struct PowerPCCPU { /*< public >*/ =20 CPUPPCState env; - int cpu_dt_id; + int vcpu_id; uint32_t compat_pvr; PPCVirtualHypervisor *vhyp; Object *intc; @@ -2514,22 +2514,22 @@ static inline bool lsw_reg_in_range(int start, int = nregs, int rx) void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env); =20 /** - * ppc_get_vcpu_dt_id: + * ppc_get_vcpu_id: * @cs: a PowerPCCPU struct. * * Returns a device-tree ID for a CPU. */ -int ppc_get_vcpu_dt_id(PowerPCCPU *cpu); +int ppc_get_vcpu_id(PowerPCCPU *cpu); =20 /** - * ppc_get_vcpu_by_dt_id: - * @cpu_dt_id: a device tree id + * ppc_get_cpu_by_vcpu_id: + * @vcpu_id: a VCPU ID * - * Searches for a CPU by @cpu_dt_id. + * Searches for a CPU by @vcpu_id. * * Returns: a PowerPCCPU struct */ -PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id); +PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id); =20 void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len); #endif /* PPC_CPU_H */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 85713795de..7ccb350c5f 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -512,7 +512,7 @@ bool kvmppc_is_mem_backend_page_size_ok(const char *obj= _path) =20 unsigned long kvm_arch_vcpu_id(CPUState *cpu) { - return ppc_get_vcpu_dt_id(POWERPC_CPU(cpu)); + return ppc_get_vcpu_id(POWERPC_CPU(cpu)); } =20 /* e500 supports 2 h/w breakpoint and 2 watchpoint. diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 01723bdfec..a80e9ffdf8 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -9828,14 +9828,14 @@ static void ppc_cpu_realizefn(DeviceState *dev, Err= or **errp) } =20 #if !defined(CONFIG_USER_ONLY) - cpu->cpu_dt_id =3D (cs->cpu_index / smp_threads) * max_smt + cpu->vcpu_id =3D (cs->cpu_index / smp_threads) * max_smt + (cs->cpu_index % smp_threads); =20 - if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->cpu_dt_id)) { - error_setg(errp, "Can't create CPU with id %d in KVM", cpu->cpu_dt= _id); + if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->vcpu_id)) { + error_setg(errp, "Can't create CPU with id %d in KVM", cpu->vcpu_i= d); error_append_hint(errp, "Adjust the number of cpus to %d " "or try to raise the number of threads per core\= n", - cpu->cpu_dt_id * smp_threads / max_smt); + cpu->vcpu_id * smp_threads / max_smt); goto unrealize; } #endif --=20 2.12.1.382.gc0f9c7058 From nobody Mon Apr 29 16:08:59 2024 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 1501742038896360.90779242239114; Wed, 2 Aug 2017 23:33:58 -0700 (PDT) Received: from localhost ([::1]:40898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9hl-0007uT-Ga for importer@patchew.org; Thu, 03 Aug 2017 02:33:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dd9d1-0005MM-UI for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:29:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dd9cy-0007Ow-O3 for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:29:03 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:41133 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 1dd9cy-0007Ok-I2 for qemu-devel@nongnu.org; Thu, 03 Aug 2017 02:29:00 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v736Sd75061161 for ; Thu, 3 Aug 2017 02:29:00 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 2c3r339jm2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Aug 2017 02:28:59 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Aug 2017 16:28:56 +1000 Received: from d23relay06.au.ibm.com (202.81.31.225) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 Aug 2017 16:28:54 +1000 Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v736SsVV15663120; Thu, 3 Aug 2017 16:28:54 +1000 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v736SrRR008250; Thu, 3 Aug 2017 16:28:53 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v736SrP6008245; Thu, 3 Aug 2017 16:28:53 +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 5D68AA0098; Thu, 3 Aug 2017 16:28:53 +1000 (AEST) Date: Thu, 3 Aug 2017 16:28:52 +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-0048-0000-0000-000002577B0B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080306-0049-0000-0000-0000480A44E9 Message-Id: <696b158f34bcf950f95709927f7496b5a4426229.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 4/4] ppc: spapr: Make VCPU ID handling private to SPAPR 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 concept of a VCPU ID that differs from the CPU's index (cpu->cpu_index) exists only within SPAPR machines so, move the functions ppc_get_vcpu_id() and ppc_get_cpu_by_vcpu_id() into spapr.c and rename them appropriately. Signed-off-by: Sam Bobroff Reviewed-by: Greg Kurz --- hw/ppc/ppc.c | 21 --------------------- hw/ppc/spapr.c | 34 +++++++++++++++++++++++++++------- hw/ppc/spapr_hcall.c | 4 ++-- hw/ppc/spapr_rtas.c | 4 ++-- include/hw/ppc/spapr.h | 3 +++ target/ppc/cpu.h | 18 ------------------ target/ppc/kvm.c | 2 +- 7 files changed, 35 insertions(+), 51 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 4477d4ad89..f76886f4d3 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -1358,27 +1358,6 @@ void PPC_debug_write (void *opaque, uint32_t addr, u= int32_t val) } } =20 -/* CPU device-tree ID helpers */ -int ppc_get_vcpu_id(PowerPCCPU *cpu) -{ - return cpu->vcpu_id; -} - -PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id) -{ - CPUState *cs; - - CPU_FOREACH(cs) { - PowerPCCPU *cpu =3D POWERPC_CPU(cs); - - if (cpu->vcpu_id =3D=3D vcpu_id) { - return cpu; - } - } - - return NULL; -} - void ppc_cpu_parse_features(const char *cpu_model) { CPUClass *cc; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 83c77096a6..0b5ffc5e9b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -208,7 +208,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset= , PowerPCCPU *cpu, int i, ret =3D 0; uint32_t servers_prop[smt_threads]; uint32_t gservers_prop[smt_threads * 2]; - int index =3D ppc_get_vcpu_id(cpu); + int index =3D spapr_vcpu_id(cpu); =20 if (cpu->compat_pvr) { ret =3D fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_p= vr); @@ -237,7 +237,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset= , PowerPCCPU *cpu, =20 static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu) { - int index =3D ppc_get_vcpu_id(cpu); + int index =3D spapr_vcpu_id(cpu); uint32_t associativity[] =3D {cpu_to_be32(0x5), cpu_to_be32(0x0), cpu_to_be32(0x0), @@ -341,7 +341,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineSt= ate *spapr) PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - int index =3D ppc_get_vcpu_id(cpu); + int index =3D spapr_vcpu_id(cpu); int compat_smt =3D MIN(smp_threads, ppc_compat_max_threads(cpu)); =20 if ((index % smt) !=3D 0) { @@ -493,7 +493,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *f= dt, int offset, PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cs); - int index =3D ppc_get_vcpu_id(cpu); + int index =3D spapr_vcpu_id(cpu); uint32_t segs[] =3D {cpu_to_be32(28), cpu_to_be32(40), 0xffffffff, 0xffffffff}; uint32_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() @@ -626,7 +626,7 @@ static void spapr_populate_cpus_dt_node(void *fdt, sPAP= RMachineState *spapr) */ CPU_FOREACH_REVERSE(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); - int index =3D ppc_get_vcpu_id(cpu); + int index =3D spapr_vcpu_id(cpu); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); int offset; =20 @@ -2982,7 +2982,7 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState *= cs, int *fdt_offset, { PowerPCCPU *cpu =3D POWERPC_CPU(cs); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - int id =3D ppc_get_vcpu_id(cpu); + int id =3D spapr_vcpu_id(cpu); void *fdt; int offset, fdt_size; char *nodename; @@ -3392,7 +3392,7 @@ static void spapr_ics_resend(XICSFabric *dev) =20 static ICPState *spapr_icp_get(XICSFabric *xi, int vcpu_id) { - PowerPCCPU *cpu =3D ppc_get_cpu_by_vcpu_id(vcpu_id); + PowerPCCPU *cpu =3D spapr_find_cpu(vcpu_id); =20 return cpu ? ICP(cpu->intc) : NULL; } @@ -3412,6 +3412,26 @@ static void spapr_pic_print_info(InterruptStatsProvi= der *obj, ics_pic_print_info(spapr->ics, mon); } =20 +int spapr_vcpu_id(PowerPCCPU *cpu) +{ + return cpu->vcpu_id; +} + +PowerPCCPU *spapr_find_cpu(int vcpu_id) +{ + CPUState *cs; + + CPU_FOREACH(cs) { + PowerPCCPU *cpu =3D POWERPC_CPU(cs); + + if (cpu->vcpu_id =3D=3D vcpu_id) { + return cpu; + } + } + + return NULL; +} + static void spapr_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 4ca233854a..7cf0993800 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -999,7 +999,7 @@ static target_ulong h_register_vpa(PowerPCCPU *cpu, sPA= PRMachineState *spapr, CPUPPCState *tenv; PowerPCCPU *tcpu; =20 - tcpu =3D ppc_get_cpu_by_vcpu_id(procno); + tcpu =3D spapr_find_cpu(procno); if (!tcpu) { return H_PARAMETER; } @@ -1431,7 +1431,7 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cp= u, =20 } else { /* Unicast */ - cs =3D CPU(ppc_get_cpu_by_vcpu_id(target)); + cs =3D CPU(spapr_find_cpu(target)); if (cs) { run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL); return H_SUCCESS; diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 626c06b375..cdf0b607a0 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -104,7 +104,7 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cp= u_, } =20 id =3D rtas_ld(args, 0); - cpu =3D ppc_get_cpu_by_vcpu_id(id); + cpu =3D spapr_find_cpu(id); if (cpu !=3D NULL) { if (CPU(cpu)->halted) { rtas_st(rets, 1, 0); @@ -158,7 +158,7 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPRMachi= neState *spapr, start =3D rtas_ld(args, 1); r3 =3D rtas_ld(args, 2); =20 - cpu =3D ppc_get_cpu_by_vcpu_id(id); + cpu =3D spapr_find_cpu(id); if (cpu !=3D NULL) { CPUState *cs =3D CPU(cpu); CPUPPCState *env =3D &cpu->env; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 2a303a705c..86c982cf2c 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -704,4 +704,7 @@ void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_= cpu_data arg); =20 #define HTAB_SIZE(spapr) (1ULL << ((spapr)->htab_shift)) =20 +int spapr_vcpu_id(PowerPCCPU *cpu); +PowerPCCPU *spapr_find_cpu(int vcpu_id); + #endif /* HW_SPAPR_H */ diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 89f05542c6..a5c7ace266 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2513,23 +2513,5 @@ static inline bool lsw_reg_in_range(int start, int n= regs, int rx) =20 void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env); =20 -/** - * ppc_get_vcpu_id: - * @cs: a PowerPCCPU struct. - * - * Returns a device-tree ID for a CPU. - */ -int ppc_get_vcpu_id(PowerPCCPU *cpu); - -/** - * ppc_get_cpu_by_vcpu_id: - * @vcpu_id: a VCPU ID - * - * Searches for a CPU by @vcpu_id. - * - * Returns: a PowerPCCPU struct - */ -PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id); - void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len); #endif /* PPC_CPU_H */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 7ccb350c5f..2bf2727860 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -512,7 +512,7 @@ bool kvmppc_is_mem_backend_page_size_ok(const char *obj= _path) =20 unsigned long kvm_arch_vcpu_id(CPUState *cpu) { - return ppc_get_vcpu_id(POWERPC_CPU(cpu)); + return spapr_vcpu_id(POWERPC_CPU(cpu)); } =20 /* e500 supports 2 h/w breakpoint and 2 watchpoint. --=20 2.12.1.382.gc0f9c7058