Lines Matching full:model
92 CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"),
104 /* features part of a base model but not relevant for finding a base model */
165 if (!cpu || !cpu->model) { in s390_get_hmfai()
168 return cpu->model->def->hmfai; in s390_get_hmfai()
179 if (!cpu || !cpu->model) { in s390_get_mha_pow()
182 return cpu->model->def->mha_pow; in s390_get_mha_pow()
194 if (!cpu || !cpu->model) { in s390_get_ibc_val()
197 unblocked_ibc = s390_ibc_from_cpu_model(cpu->model); in s390_get_ibc_val()
198 lowest_ibc = cpu->model->lowest_ibc; in s390_get_ibc_val()
210 if (!cpu || !cpu->model) { in s390_get_feat_block()
213 s390_fill_feat_block(cpu->model->features, type, data); in s390_get_feat_block()
224 if (!cpu || !cpu->model) { in s390_has_feat()
271 return test_bit(feat, cpu->model->features); in s390_has_feat()
314 /* see if the model satisfies the minimum features */ in s390_find_cpu_def()
317 * Ignore certain features that are in the base model, but not in s390_find_cpu_def()
326 /* stop the search if we found the exact model */ in s390_find_cpu_def()
336 /* prefer the model with the same cpu type, esp. don't take the BC for EC */ in s390_find_cpu_def()
404 /* exact same definition - list base model first */ in s390_cpu_list_compare()
435 static void check_consistency(const S390CPUModel *model) in check_consistency() argument
499 if (test_bit(dep[i][0], model->features) && in check_consistency()
500 !test_bit(dep[i][1], model->features)) { in check_consistency()
517 error_setg(errp, "%s. Maximum supported model in the current configuration: \'%s\'", in check_compat_model_failed()
524 const S390CPUModel *model, Error **errp) in check_compatibility() argument
529 if (model->def->gen > max_model->def->gen) { in check_compatibility()
532 } else if (model->def->gen == max_model->def->gen && in check_compatibility()
533 model->def->ec_ga > max_model->def->ec_ga) { in check_compatibility()
539 if (only_migratable && test_bit(S390_FEAT_UNPACK, model->features)) { in check_compatibility()
548 bitmap_andnot(missing, model->features, max_model->features, S390_FEAT_MAX); in check_compatibility()
555 error_prepend(errp, "Some features requested in the CPU model are not " in check_compatibility()
596 if (!cpu->model) { in s390_realize_cpu_model()
597 /* no host model support -> perform compatibility stuff */ in s390_realize_cpu_model()
609 cpu->model->lowest_ibc = max_model->lowest_ibc; in s390_realize_cpu_model()
610 cpu->model->cpu_id = max_model->cpu_id; in s390_realize_cpu_model()
611 cpu->model->cpu_id_format = max_model->cpu_id_format; in s390_realize_cpu_model()
612 cpu->model->cpu_ver = max_model->cpu_ver; in s390_realize_cpu_model()
614 check_consistency(cpu->model); in s390_realize_cpu_model()
615 if (!check_compatibility(max_model, cpu->model, errp)) { in s390_realize_cpu_model()
619 apply_cpu_model(cpu->model, errp); in s390_realize_cpu_model()
622 cpu->env.cpuid = s390_cpuid_from_cpu_model(cpu->model); in s390_realize_cpu_model()
637 if (!cpu->model) { in get_feature()
638 error_setg(errp, "Details about the host CPU model are not available, " in get_feature()
643 value = test_bit(feat, cpu->model->features); in get_feature()
659 } else if (!cpu->model) { in set_feature()
660 error_setg(errp, "Details about the host CPU model are not available, " in set_feature()
669 if (!test_bit(feat, cpu->model->def->full_feat)) { in set_feature()
670 error_setg(errp, "Feature '%s' is not available for CPU model '%s'," in set_feature()
672 name, cpu->model->def->name); in set_feature()
675 set_bit(feat, cpu->model->features); in set_feature()
677 clear_bit(feat, cpu->model->features); in set_feature()
690 if (!cpu->model) { in get_feature_group()
691 error_setg(errp, "Details about the host CPU model are not available, " in get_feature_group()
697 bitmap_and(tmp, cpu->model->features, def->feat, S390_FEAT_MAX); in get_feature_group()
715 } else if (!cpu->model) { in set_feature_group()
716 error_setg(errp, "Details about the host CPU model are not available, " in set_feature_group()
726 if (!bitmap_intersects(def->feat, cpu->model->def->full_feat, in set_feature_group()
728 error_setg(errp, "Group '%s' is not available for CPU model '%s'," in set_feature_group()
730 name, cpu->model->def->name); in set_feature_group()
733 bitmap_or(cpu->model->features, cpu->model->features, def->feat, in set_feature_group()
736 bitmap_andnot(cpu->model->features, cpu->model->features, def->feat, in set_feature_group()
746 cpu->model = g_malloc0(sizeof(*cpu->model)); in s390_cpu_model_initfn()
747 /* copy the model, so we can modify it */ in s390_cpu_model_initfn()
748 cpu->model->def = xcc->cpu_def; in s390_cpu_model_initfn()
750 /* base model - features will never change */ in s390_cpu_model_initfn()
751 bitmap_copy(cpu->model->features, cpu->model->def->base_feat, in s390_cpu_model_initfn()
754 /* latest model - features can change */ in s390_cpu_model_initfn()
755 bitmap_copy(cpu->model->features, in s390_cpu_model_initfn()
756 cpu->model->def->default_feat, S390_FEAT_MAX); in s390_cpu_model_initfn()
762 /* Set the qemu CPU model (on machine initialization). Must not be called
773 /* build the CPU model */ in s390_set_qemu_cpu_model()
783 cpu->model = g_malloc0(sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
784 /* copy the CPU model so we can modify it */ in s390_qemu_cpu_model_initfn()
785 memcpy(cpu->model, &s390_qemu_cpu_model, sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
795 /* "max" and "host" always work, even without CPU model support */ in s390_max_cpu_model_initfn()
808 cpu->model = g_new(S390CPUModel, 1); in s390_max_cpu_model_initfn()
809 /* copy the CPU model so we can modify it */ in s390_max_cpu_model_initfn()
810 memcpy(cpu->model, max_model, sizeof(*cpu->model)); in s390_max_cpu_model_initfn()
817 g_free(cpu->model); in s390_cpu_model_finalize()
818 cpu->model = NULL; in s390_cpu_model_finalize()
886 /* model that can change between QEMU versions */ in s390_cpu_model_class_init()
906 * The "max" model is neither static nor migration safe. Under KVM in s390_max_cpu_model_class_init()
907 * it represents the "host" model. Under TCG it represents the "qemu" CPU in s390_max_cpu_model_class_init()
908 * model of the latest QEMU machine. in s390_max_cpu_model_class_init()
914 /* Generate type name for a cpu model. Caller has to free the string. */
920 /* Generate type name for a base cpu model. Caller has to free the string. */
1003 /* initialize the qemu model with the maximum definition ("max" model) */ in register_types()