mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
spapr: cleanup spapr_fixup_cpu_numa_dt() usage
even though spapr_fixup_cpu_numa_dt() has no effect on FDT if numa is disabled, don't call it uselessly. It makes it obvious at call sites that function is needed only when numa is enabled. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1496161442-96665-7-git-send-email-imammedo@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
15f8b14228
commit
99861ecbc5
1 changed files with 10 additions and 12 deletions
|
@ -182,10 +182,8 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, CPUState *cs)
|
static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
|
||||||
int index = ppc_get_vcpu_dt_id(cpu);
|
int index = ppc_get_vcpu_dt_id(cpu);
|
||||||
uint32_t associativity[] = {cpu_to_be32(0x5),
|
uint32_t associativity[] = {cpu_to_be32(0x5),
|
||||||
cpu_to_be32(0x0),
|
cpu_to_be32(0x0),
|
||||||
|
@ -195,14 +193,10 @@ static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, CPUState *cs)
|
||||||
cpu_to_be32(index)};
|
cpu_to_be32(index)};
|
||||||
|
|
||||||
/* Advertise NUMA via ibm,associativity */
|
/* Advertise NUMA via ibm,associativity */
|
||||||
if (nb_numa_nodes > 1) {
|
return fdt_setprop(fdt, offset, "ibm,associativity", associativity,
|
||||||
ret = fdt_setprop(fdt, offset, "ibm,associativity", associativity,
|
|
||||||
sizeof(associativity));
|
sizeof(associativity));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Populate the "ibm,pa-features" property */
|
/* Populate the "ibm,pa-features" property */
|
||||||
static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset,
|
static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset,
|
||||||
bool legacy_guest)
|
bool legacy_guest)
|
||||||
|
@ -325,10 +319,12 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = spapr_fixup_cpu_numa_dt(fdt, offset, cs);
|
if (nb_numa_nodes > 1) {
|
||||||
|
ret = spapr_fixup_cpu_numa_dt(fdt, offset, cpu);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt);
|
ret = spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -542,7 +538,9 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,
|
||||||
_FDT((fdt_setprop(fdt, offset, "ibm,pft-size",
|
_FDT((fdt_setprop(fdt, offset, "ibm,pft-size",
|
||||||
pft_size_prop, sizeof(pft_size_prop))));
|
pft_size_prop, sizeof(pft_size_prop))));
|
||||||
|
|
||||||
_FDT(spapr_fixup_cpu_numa_dt(fdt, offset, cs));
|
if (nb_numa_nodes > 1) {
|
||||||
|
_FDT(spapr_fixup_cpu_numa_dt(fdt, offset, cpu));
|
||||||
|
}
|
||||||
|
|
||||||
_FDT(spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt));
|
_FDT(spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue