static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset)

{

    uint8_t pa_features_206[] = { 6, 0,

        0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 };

    uint8_t pa_features_207[] = { 24, 0,

        0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0,

        0x80, 0x00, 0x00, 0x00, 0x00, 0x00,

        0x00, 0x00, 0x00, 0x00, 0x80, 0x00,

        0x80, 0x00, 0x80, 0x00, 0x00, 0x00 };

    uint8_t pa_features_300[] = { 66, 0,

        

        

        0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, 

        

        0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 

        

        0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0xC0, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 

        

        0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 

    };

    uint8_t *pa_features;

    size_t pa_size;



    switch (POWERPC_MMU_VER(env->mmu_model)) {

    case POWERPC_MMU_VER_2_06:

        pa_features = pa_features_206;

        pa_size = sizeof(pa_features_206);

        break;

    case POWERPC_MMU_VER_2_07:

        pa_features = pa_features_207;

        pa_size = sizeof(pa_features_207);

        break;

    case POWERPC_MMU_VER_3_00:

        pa_features = pa_features_300;

        pa_size = sizeof(pa_features_300);

        break;

    default:

        return;

    }



    if (env->ci_large_pages) {

        













        pa_features[3] |= 0x20;

    }

    if (kvmppc_has_cap_htm() && pa_size > 24) {

        pa_features[24] |= 0x80;    

    }



    _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size)));

}
