diff options
author | Sam Bobroff <sam.bobroff@au1.ibm.com> | 2017-08-03 16:28:44 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-09-08 09:30:55 +1000 |
commit | 81210c2009296261879af5d58a3a499815031765 (patch) | |
tree | eeeefcf5c0a44318da81a5d962b49f3dcb380654 /hw | |
parent | 6d536570198460743d01a7dc08deda56deee66ab (diff) |
ppc: spapr: Rename cpu_dt_id to vcpu_id
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 <sam.bobroff@au1.ibm.com>
[dwg: Updated comment missed in cpu.h]
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/ppc.c | 8 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 16 | ||||
-rw-r--r-- | hw/ppc/spapr_hcall.c | 4 | ||||
-rw-r--r-- | hw/ppc/spapr_rtas.c | 4 |
4 files changed, 16 insertions, 16 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) } /* 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; } -PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id) +PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id) { CPUState *cs; CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - if (cpu->cpu_dt_id == cpu_dt_id) { + if (cpu->vcpu_id == vcpu_id) { return cpu; } } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a0c5923776..f7a4c73e08 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 = 0; uint32_t servers_prop[smt_threads]; uint32_t gservers_prop[smt_threads * 2]; - int index = ppc_get_vcpu_dt_id(cpu); + int index = ppc_get_vcpu_id(cpu); if (cpu->compat_pvr) { ret = fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_pvr); @@ -237,7 +237,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu, static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu) { - int index = ppc_get_vcpu_dt_id(cpu); + int index = ppc_get_vcpu_id(cpu); uint32_t associativity[] = {cpu_to_be32(0x5), cpu_to_be32(0x0), cpu_to_be32(0x0), @@ -341,7 +341,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; DeviceClass *dc = DEVICE_GET_CLASS(cs); - int index = ppc_get_vcpu_dt_id(cpu); + int index = ppc_get_vcpu_id(cpu); int compat_smt = MIN(smp_threads, ppc_compat_max_threads(cpu)); if ((index % smt) != 0) { @@ -493,7 +493,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); - int index = ppc_get_vcpu_dt_id(cpu); + int index = ppc_get_vcpu_id(cpu); uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40), 0xffffffff, 0xffffffff}; uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() @@ -626,7 +626,7 @@ static void spapr_populate_cpus_dt_node(void *fdt, sPAPRMachineState *spapr) */ CPU_FOREACH_REVERSE(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - int index = ppc_get_vcpu_dt_id(cpu); + int index = ppc_get_vcpu_id(cpu); DeviceClass *dc = DEVICE_GET_CLASS(cs); int offset; @@ -3025,7 +3025,7 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState *cs, int *fdt_offset, { PowerPCCPU *cpu = POWERPC_CPU(cs); DeviceClass *dc = DEVICE_GET_CLASS(cs); - int id = ppc_get_vcpu_dt_id(cpu); + int id = ppc_get_vcpu_id(cpu); void *fdt; int offset, fdt_size; char *nodename; @@ -3433,9 +3433,9 @@ static void spapr_ics_resend(XICSFabric *dev) ics_resend(spapr->ics); } -static ICPState *spapr_icp_get(XICSFabric *xi, int cpu_dt_id) +static ICPState *spapr_icp_get(XICSFabric *xi, int vcpu_id) { - PowerPCCPU *cpu = ppc_get_vcpu_by_dt_id(cpu_dt_id); + PowerPCCPU *cpu = ppc_get_cpu_by_vcpu_id(vcpu_id); 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, sPAPRMachineState *spapr, CPUPPCState *tenv; PowerPCCPU *tcpu; - tcpu = ppc_get_vcpu_by_dt_id(procno); + tcpu = ppc_get_cpu_by_vcpu_id(procno); if (!tcpu) { return H_PARAMETER; } @@ -1431,7 +1431,7 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu, } else { /* Unicast */ - cs = CPU(ppc_get_vcpu_by_dt_id(target)); + cs = 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 *cpu_, } id = rtas_ld(args, 0); - cpu = ppc_get_vcpu_by_dt_id(id); + cpu = ppc_get_cpu_by_vcpu_id(id); if (cpu != NULL) { if (CPU(cpu)->halted) { rtas_st(rets, 1, 0); @@ -158,7 +158,7 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPRMachineState *spapr, start = rtas_ld(args, 1); r3 = rtas_ld(args, 2); - cpu = ppc_get_vcpu_by_dt_id(id); + cpu = ppc_get_cpu_by_vcpu_id(id); if (cpu != NULL) { CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; |