On 10/28/2016 06:46 PM, Benjamin Herrenschmidt wrote: > On Fri, 2016-10-28 at 18:40 +0200, Cédric Le Goater wrote: >> >> It makes perfect sense. The "cpu-version" property is for PAPR, not >> for OPAL. >> hostboot and skiboot put SPR_PVR in this property. >> >> I will be careful using 'CPU_CORE(pc)->nr_threads' in the ICP patches >> also. > > No, the cpu-version is part of the old OF bindings afaik, at least it > exists under OPAL, so it should be there but yes, it should just > contain the PVR.
powernv_create_core_node() sets "cpu-version" twice : _FDT((fdt_setprop_cell(fdt, offset, "cpu-version", env->spr[SPR_PVR]))); and then : if (cpu->cpu_version) { _FDT((fdt_setprop_cell(fdt, offset, "cpu-version", cpu->cpu_version))); } but the patch only removes the second one but you don't really see the first ... I should have said that. Cheers, C. > Cheers, > Ben. > >> Reviewed-by: Cédric Le Goater <c...@kaod.org> >> >> Thanks, >> >> C. >> >> >>> >>> >>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c >>> index 82276e0..6af3424 100644 >>> --- a/hw/ppc/pnv.c >>> +++ b/hw/ppc/pnv.c >>> @@ -110,7 +110,7 @@ static void powernv_create_core_node(PnvChip >>> *chip, PnvCore *pc, void *fdt) >>> CPUState *cs = CPU(DEVICE(pc->threads)); >>> DeviceClass *dc = DEVICE_GET_CLASS(cs); >>> PowerPCCPU *cpu = POWERPC_CPU(cs); >>> - int smt_threads = ppc_get_compat_smt_threads(cpu); >>> + int smt_threads = CPU_CORE(pc)->nr_threads; >>> CPUPPCState *env = &cpu->env; >>> PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); >>> uint32_t servers_prop[smt_threads]; >>> @@ -206,10 +206,6 @@ static void powernv_create_core_node(PnvChip >>> *chip, PnvCore *pc, void *fdt) >>> _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", >>> pa_features, sizeof(pa_features)))); >>> >>> - if (cpu->cpu_version) { >>> - _FDT((fdt_setprop_cell(fdt, offset, "cpu-version", cpu- >>>> cpu_version))); >>> - } >>> - >>> /* Build interrupt servers properties */ >>> for (i = 0; i < smt_threads; i++) { >>> servers_prop[i] = cpu_to_be32(pc->pir + i); >>>