[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 09/14] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 09/14] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id() |
Date: |
Fri, 16 Feb 2018 21:06:12 +1100 |
From: Greg Kurz <address@hidden>
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 <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
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 = 0;
uint32_t servers_prop[smt_threads];
uint32_t gservers_prop[smt_threads * 2];
- int index = spapr_vcpu_id(cpu);
+ int index = spapr_get_vcpu_id(cpu);
if (cpu->compat_pvr) {
ret = fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_pvr);
@@ -238,7 +238,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 = spapr_vcpu_id(cpu);
+ int index = spapr_get_vcpu_id(cpu);
uint32_t associativity[] = {cpu_to_be32(0x5),
cpu_to_be32(0x0),
cpu_to_be32(0x0),
@@ -342,7 +342,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState
*spapr)
CPU_FOREACH(cs) {
PowerPCCPU *cpu = POWERPC_CPU(cs);
DeviceClass *dc = DEVICE_GET_CLASS(cs);
- int index = spapr_vcpu_id(cpu);
+ int index = spapr_get_vcpu_id(cpu);
int compat_smt = MIN(smp_threads, ppc_compat_max_vthreads(cpu));
if (index % spapr->vsmt != 0) {
@@ -492,7 +492,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 = spapr_vcpu_id(cpu);
+ int index = spapr_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 = spapr_vcpu_id(cpu);
+ int index = spapr_get_vcpu_id(cpu);
DeviceClass *dc = DEVICE_GET_CLASS(cs);
int offset;
@@ -3234,7 +3234,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 = spapr_vcpu_id(cpu);
+ int id = spapr_get_vcpu_id(cpu);
void *fdt;
int offset, fdt_size;
char *nodename;
@@ -3791,7 +3791,7 @@ static void spapr_pic_print_info(InterruptStatsProvider
*obj,
ics_pic_print_info(spapr->ics, mon);
}
-int spapr_vcpu_id(PowerPCCPU *cpu)
+int spapr_get_vcpu_id(PowerPCCPU *cpu)
{
CPUState *cs = CPU(cpu);
@@ -3828,7 +3828,7 @@ PowerPCCPU *spapr_find_cpu(int vcpu_id)
CPU_FOREACH(cs) {
PowerPCCPU *cpu = POWERPC_CPU(cs);
- if (spapr_vcpu_id(cpu) == vcpu_id) {
+ if (spapr_get_vcpu_id(cpu) == 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);
#define HTAB_SIZE(spapr) (1ULL << ((spapr)->htab_shift))
-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);
--
2.14.3
- [Qemu-ppc] [PULL 00/14] ppc-for-2.12 queue 20180216, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 06/14] ppc/spapr-caps: Change migration macro to take full spapr-cap name, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 04/14] hw/ppc/spapr_hcall: set htab_shift after kvmppc_resize_hpt_commit, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 13/14] ppc/spapr-caps: Disallow setting workaround for spapr-cap-ibs, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 08/14] spapr: move VCPU calculation to core machine code, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 09/14] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id(),
David Gibson <=
- [Qemu-ppc] [PULL 02/14] ppc: move CUDAState and other CUDA-related definitions into separate cuda.h file, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 12/14] target/ppc: convert to TranslatorOps, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 10/14] spapr: consolidate the VCPU id numbering logic in a single place, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 03/14] cuda: convert to trace-events, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 07/14] spapr: use spapr->vsmt to compute VCPU ids, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 05/14] hw/char: remove legacy interface escc_init(), David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 11/14] target/ppc: convert to DisasContextBase, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 01/14] cuda: convert to use the shared mos6522 device, David Gibson, 2018/02/16
- [Qemu-ppc] [PULL 14/14] ppc4xx: Add device models found in PPC440 core SoCs, David Gibson, 2018/02/16
- Re: [Qemu-ppc] [PULL 00/14] ppc-for-2.12 queue 20180216, Peter Maydell, 2018/02/16