static int spapr_set_associativity(void *fdt, sPAPREnvironment *spapr)

{

    int ret = 0, offset;

    CPUPPCState *env;

    char cpu_model[32];

    int smt = kvmppc_smt_threads();



    assert(spapr->cpu_model);



    for (env = first_cpu; env != NULL; env = env->next_cpu) {

        uint32_t associativity[] = {cpu_to_be32(0x5),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(env->numa_node),

                                    cpu_to_be32(env->cpu_index)};



        if ((env->cpu_index % smt) != 0) {

            continue;

        }



        snprintf(cpu_model, 32, "/cpus/%s@%x", spapr->cpu_model,

                 env->cpu_index);



        offset = fdt_path_offset(fdt, cpu_model);

        if (offset < 0) {

            return offset;

        }



        ret = fdt_setprop(fdt, offset, "ibm,associativity", associativity,

                          sizeof(associativity));

        if (ret < 0) {

            return ret;

        }

    }

    return ret;

}

static int spapr_set_associativity(void *fdt, sPAPREnvironment *spapr)

{

    int ret = 0, offset;

    CPUPPCState *env;

    char cpu_model[32];

    int smt = kvmppc_smt_threads();



    assert(spapr->cpu_model);



    for (env = first_cpu; env != NULL; env = env->next_cpu) {

        uint32_t associativity[] = {cpu_to_be32(0x5),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(env->numa_node),

                                    cpu_to_be32(env->cpu_index)};



        if ((env->cpu_index % smt) != 0) {

            continue;

        }



        snprintf(cpu_model, 32, "/cpus/%s@%x", spapr->cpu_model,

                 env->cpu_index);



        offset = fdt_path_offset(fdt, cpu_model);

        if (offset < 0) {

            return offset;

        }



        ret = fdt_setprop(fdt, offset, "ibm,associativity", associativity,

                          sizeof(associativity));

        if (ret < 0) {

            return ret;

        }

    }

    return ret;

}

static int spapr_set_associativity(void *fdt, sPAPREnvironment *spapr)         ret = fdt_setprop(fdt, offset, "ibm,associativity", associativity,                           sizeof(associativity));     int smt = kvmppc_smt_threads();         if (ret < 0) {     for (env = first_cpu; env != NULL; env = env->next_cpu) {
static int FUNC_0(void *VAR_0, sPAPREnvironment *VAR_1)

{

    int VAR_2 = 0, VAR_3;

    CPUPPCState *env;

    char VAR_4[32];

    int VAR_5 = kvmppc_smt_threads();



    assert(VAR_1->VAR_4);



    for (env = first_cpu; env != NULL; env = env->next_cpu) {

        uint32_t associativity[] = {cpu_to_be32(0x5),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(0x0),

                                    cpu_to_be32(env->numa_node),

                                    cpu_to_be32(env->cpu_index)};



        if ((env->cpu_index % VAR_5) != 0) {

            continue;

        }



        snprintf(VAR_4, 32, "/cpus/%s@%x", VAR_1->VAR_4,

                 env->cpu_index);



        VAR_3 = fdt_path_offset(VAR_0, VAR_4);

        if (VAR_3 < 0) {

            return VAR_3;

        }



        VAR_2 = fdt_setprop(VAR_0, VAR_3, "ibm,associativity", associativity,

                          sizeof(associativity));

        if (VAR_2 < 0) {

            return VAR_2;

        }

    }

    return VAR_2;

}

static int FUNC_0(void *VAR_0, sPAPREnvironment *VAR_1)
{ int VAR_2 = 0, VAR_3; CPUPPCState *env; char VAR_4[32]; int VAR_5 = kvmppc_smt_threads(); assert(VAR_1->VAR_4); for (env = first_cpu; env != NULL; env = env->next_cpu) { uint32_t associativity[] = {cpu_to_be32(0x5), cpu_to_be32(0x0),
cpu_to_be32(0x0),
cpu_to_be32(0x0),
cpu_to_be32(env->numa_node),
cpu_to_be32(env->cpu_index)}; if ((env->cpu_index % VAR_5) != 0) { continue; } snprintf(VAR_4, 32, "/cpus/%s@%x", VAR_1->VAR_4,
env->cpu_index); VAR_3 = fdt_path_offset(VAR_0, VAR_4); if (VAR_3 < 0) { return VAR_3; } VAR_2 = fdt_setprop(VAR_0, VAR_3, "ibm,associativity", associativity,
sizeof(associativity)); if (VAR_2 < 0) { return VAR_2; } } return VAR_2; }