From nobody Fri Oct 24 20:18:49 2025 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 1518775920992967.124727561967; Fri, 16 Feb 2018 02:12:00 -0800 (PST) Received: from localhost ([::1]:59105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emczo-00063v-3m for importer@patchew.org; Fri, 16 Feb 2018 05:12:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emcuW-0001c1-03 for qemu-devel@nongnu.org; Fri, 16 Feb 2018 05:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emcuT-0005Ej-Lm for qemu-devel@nongnu.org; Fri, 16 Feb 2018 05:06:31 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:37685) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emcuT-00058H-36; Fri, 16 Feb 2018 05:06:29 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3zjTLl3JSqz9t6l; Fri, 16 Feb 2018 21:06:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1518775583; bh=xzQmf4e/ddLRsM4p5m2oXNLpyXlddBWN9AavxGWh8cM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/DMuaO5mO2xos653YmuMUcW7BauGO9Rh4q7V/HVlGxeplJvowL/vgHH7Aie8biaj yrED2qeFnja8FGScFAZtTuqwO97DTdqAbUiH9tJNo3eAAKc5pfm909sNl1EIiD0yKo EASUiqfjovfSGJhagx2Tw/IgY8M3I3Zy1Yv2VigM= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 16 Feb 2018 21:06:12 +1100 Message-Id: <20180216100617.25265-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180216100617.25265-1-david@gibson.dropbear.id.au> References: <20180216100617.25265-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 09/14] spapr: rename spapr_vcpu_id() to spapr_get_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: lvivier@redhat.com, surajjs@au1.ibm.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, 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: Greg Kurz The spapr_vcpu_id() function is an accessor actually. Let's rename it for symmetry with the recently added spapr_set_vcpu_id() helper. The motivation behind this is that a later patch will consolidate the VCPU id formula in a function and spapr_vcpu_id looks like an appropriate name. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 16 ++++++++-------- include/hw/ppc/spapr.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 30cc48fd52..18ebc058ac 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -209,7 +209,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 spapr_vcpu_id(cpu); + int index =3D spapr_get_vcpu_id(cpu); =20 if (cpu->compat_pvr) { ret =3D fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_p= vr); @@ -238,7 +238,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 spapr_vcpu_id(cpu); + int index =3D spapr_get_vcpu_id(cpu); uint32_t associativity[] =3D {cpu_to_be32(0x5), cpu_to_be32(0x0), cpu_to_be32(0x0), @@ -342,7 +342,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineSt= ate *spapr) CPU_FOREACH(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); - int index =3D spapr_vcpu_id(cpu); + int index =3D spapr_get_vcpu_id(cpu); int compat_smt =3D MIN(smp_threads, ppc_compat_max_vthreads(cpu)); =20 if (index % spapr->vsmt !=3D 0) { @@ -492,7 +492,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 spapr_vcpu_id(cpu); + int index =3D spapr_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 spapr_vcpu_id(cpu); + int index =3D spapr_get_vcpu_id(cpu); DeviceClass *dc =3D DEVICE_GET_CLASS(cs); int offset; =20 @@ -3234,7 +3234,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 spapr_vcpu_id(cpu); + int id =3D spapr_get_vcpu_id(cpu); void *fdt; int offset, fdt_size; char *nodename; @@ -3791,7 +3791,7 @@ static void spapr_pic_print_info(InterruptStatsProvid= er *obj, ics_pic_print_info(spapr->ics, mon); } =20 -int spapr_vcpu_id(PowerPCCPU *cpu) +int spapr_get_vcpu_id(PowerPCCPU *cpu) { CPUState *cs =3D CPU(cpu); =20 @@ -3828,7 +3828,7 @@ PowerPCCPU *spapr_find_cpu(int vcpu_id) CPU_FOREACH(cs) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); =20 - if (spapr_vcpu_id(cpu) =3D=3D vcpu_id) { + if (spapr_get_vcpu_id(cpu) =3D=3D vcpu_id) { return cpu; } } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index af19320d2f..36942b378d 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -766,7 +766,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); +int spapr_get_vcpu_id(PowerPCCPU *cpu); void spapr_set_vcpu_id(PowerPCCPU *cpu, int cpu_index, Error **errp); PowerPCCPU *spapr_find_cpu(int vcpu_id); =20 --=20 2.14.3