Lines Matching +full:gen +full:- +full:3

9  * your option) any later version. See the COPYING file in the top-level
15 #include "s390x-internal.h"
20 #include "qemu/error-report.h"
23 #include "qemu/hw-version.h"
24 #include "qemu/qemu-print.h"
35 .gen = _gen, \
53 * (see https://www.ibm.com/support/pages/ibm-mainframe-life-cycle-history),
60 CPUDEF_INIT(0x2064, 7, 3, 38, 0x00000000U, "z900.3", "IBM zSeries 900 GA3"),
61 CPUDEF_INIT(0x2066, 7, 3, 38, 0x00000000U, "z800", "IBM zSeries 800 GA1"),
64 CPUDEF_INIT(0x2084, 8, 3, 38, 0x00000000U, "z990.3", "IBM zSeries 990 GA3"),
65 CPUDEF_INIT(0x2086, 8, 3, 38, 0x00000000U, "z890", "IBM zSeries 880 GA1"),
69 CPUDEF_INIT(0x2086, 8, 5, 38, 0x00000000U, "z890.3", "IBM zSeries 880 GA3"),
73 CPUDEF_INIT(0x2094, 9, 3, 40, 0x00000000U, "z9EC.3", "IBM System z9 EC GA3"),
74 CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM System z9 BC GA2"),
79 CPUDEF_INIT(0x2097, 10, 3, 43, 0x00000000U, "z10EC.3", "IBM System z10 EC GA3"),
80 CPUDEF_INIT(0x2098, 10, 3, 43, 0x00000000U, "z10BC.2", "IBM System z10 BC GA2"),
109 void s390_cpudef_featoff(uint8_t gen, uint8_t ec_ga, S390Feat feat) in s390_cpudef_featoff() argument
113 def = s390_find_cpu_def(0, gen, ec_ga, NULL); in s390_cpudef_featoff()
114 clear_bit(feat, (unsigned long *)&def->default_feat); in s390_cpudef_featoff()
117 void s390_cpudef_featoff_greater(uint8_t gen, uint8_t ec_ga, S390Feat feat) in s390_cpudef_featoff_greater() argument
124 if (def->gen < gen) { in s390_cpudef_featoff_greater()
127 if (def->gen == gen && def->ec_ga < ec_ga) { in s390_cpudef_featoff_greater()
131 clear_bit(feat, (unsigned long *)&def->default_feat); in s390_cpudef_featoff_greater()
135 void s390_cpudef_group_featoff_greater(uint8_t gen, uint8_t ec_ga, in s390_cpudef_group_featoff_greater() argument
142 bitmap_complement(group_def_off, group_def->feat, S390_FEAT_MAX); in s390_cpudef_group_featoff_greater()
147 if (cpu_def->gen < gen) { in s390_cpudef_group_featoff_greater()
150 if (cpu_def->gen == gen && cpu_def->ec_ga < ec_ga) { in s390_cpudef_group_featoff_greater()
154 bitmap_and((unsigned long *)&cpu_def->default_feat, in s390_cpudef_group_featoff_greater()
155 cpu_def->default_feat, group_def_off, S390_FEAT_MAX); in s390_cpudef_group_featoff_greater()
167 if (!cpu || !cpu->model) { in s390_get_hmfai()
170 return cpu->model->def->hmfai; in s390_get_hmfai()
181 if (!cpu || !cpu->model) { in s390_get_mha_pow()
184 return cpu->model->def->mha_pow; in s390_get_mha_pow()
196 if (!cpu || !cpu->model) { in s390_get_ibc_val()
199 unblocked_ibc = s390_ibc_from_cpu_model(cpu->model); in s390_get_ibc_val()
200 lowest_ibc = cpu->model->lowest_ibc; in s390_get_ibc_val()
212 if (!cpu || !cpu->model) { in s390_get_feat_block()
215 s390_fill_feat_block(cpu->model->features, type, data); in s390_get_feat_block()
226 if (!cpu || !cpu->model) { in s390_has_feat()
273 return test_bit(feat, cpu->model->features); in s390_has_feat()
282 return s390_cpu_defs[i].gen; in s390_get_gen_for_cpu_type()
288 const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga, in s390_find_cpu_def() argument
295 if (!gen) { in s390_find_cpu_def()
298 if (!gen && type) { in s390_find_cpu_def()
299 gen = s390_get_gen_for_cpu_type(type); in s390_find_cpu_def()
307 if (gen) { in s390_find_cpu_def()
308 if (def->gen > gen) { in s390_find_cpu_def()
310 } else if (def->gen == gen && ec_ga && def->ec_ga > ec_ga) { in s390_find_cpu_def()
317 bitmap_andnot(missing, def->base_feat, features, S390_FEAT_MAX); in s390_find_cpu_def()
329 if (def->type == type && def->ec_ga == ec_ga) { in s390_find_cpu_def()
333 if (def->type == type) { in s390_find_cpu_def()
352 if (scc->is_static) { in s390_print_cpu_model_list_entry()
355 if (scc->is_migration_safe) { in s390_print_cpu_model_list_entry()
356 g_string_append(details, "migration-safe, "); in s390_print_cpu_model_list_entry()
358 if (cc->deprecation_note) { in s390_print_cpu_model_list_entry()
361 if (details->len) { in s390_print_cpu_model_list_entry()
363 g_string_truncate(details, details->len - 2); in s390_print_cpu_model_list_entry()
366 /* strip off the -s390x-cpu */ in s390_print_cpu_model_list_entry()
367 g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; in s390_print_cpu_model_list_entry()
368 if (details->len) { in s390_print_cpu_model_list_entry()
369 qemu_printf(" %-15s %-35s (%s)\n", name, scc->desc, details->str); in s390_print_cpu_model_list_entry()
371 qemu_printf(" %-15s %-35s\n", name, scc->desc); in s390_print_cpu_model_list_entry()
388 return -1; in s390_cpu_list_compare()
392 return -1; in s390_cpu_list_compare()
396 return -1; in s390_cpu_list_compare()
402 if (cc_a->cpu_def != cc_b->cpu_def) { in s390_cpu_list_compare()
403 return cc_a->cpu_def - cc_b->cpu_def; in s390_cpu_list_compare()
406 /* exact same definition - list base model first */ in s390_cpu_list_compare()
407 return cc_a->is_static ? -1 : 1; in s390_cpu_list_compare()
426 qemu_printf(" %-20s %s\n", def->name, def->desc); in s390_cpu_list()
433 qemu_printf(" %-20s %s\n", def->name, def->desc); in s390_cpu_list()
560 if (test_bit(dep[i][0], model->features) && in check_consistency()
561 !test_bit(dep[i][1], model->features)) { in check_consistency()
563 s390_feat_def(dep[i][0])->name, in check_consistency()
564 s390_feat_def(dep[i][1])->name); in check_consistency()
579 msg, max_model->def->name); in check_compat_model_failed()
580 error_append_hint(errp, "Consider a different accelerator, try \"-accel help\"\n"); in check_compat_model_failed()
590 if (model->def->gen > max_model->def->gen) { in check_compatibility()
593 } else if (model->def->gen == max_model->def->gen && in check_compatibility()
594 model->def->ec_ga > max_model->def->ec_ga) { in check_compatibility()
600 if (only_migratable && test_bit(S390_FEAT_UNPACK, model->features)) { in check_compatibility()
602 "the --only-migratable option. You must remove either " in check_compatibility()
603 "the 'unpack' facility or the --only-migratable option"); in check_compatibility()
609 bitmap_andnot(missing, model->features, max_model->features, S390_FEAT_MAX); in check_compatibility()
652 if (xcc->kvm_required && !kvm_enabled()) { in s390_realize_cpu_model()
657 if (!cpu->model) { in s390_realize_cpu_model()
658 /* no host model support -> perform compatibility stuff */ in s390_realize_cpu_model()
670 cpu->model->lowest_ibc = max_model->lowest_ibc; in s390_realize_cpu_model()
671 cpu->model->cpu_id = max_model->cpu_id; in s390_realize_cpu_model()
672 cpu->model->cpu_id_format = max_model->cpu_id_format; in s390_realize_cpu_model()
673 cpu->model->cpu_ver = max_model->cpu_ver; in s390_realize_cpu_model()
675 check_consistency(cpu->model); in s390_realize_cpu_model()
676 if (!check_compatibility(max_model, cpu->model, errp)) { in s390_realize_cpu_model()
680 apply_cpu_model(cpu->model, errp); in s390_realize_cpu_model()
683 cpu->env.cpuid = s390_cpuid_from_cpu_model(cpu->model); in s390_realize_cpu_model()
685 cpu->env.cpuid = deposit64(cpu->env.cpuid, CPU_PHYS_ADDR_SHIFT, in s390_realize_cpu_model()
686 CPU_PHYS_ADDR_BITS, cpu->env.core_id); in s390_realize_cpu_model()
698 if (!cpu->model) { in get_feature()
704 value = test_bit(feat, cpu->model->features); in get_feature()
716 if (dev->realized) { in set_feature()
720 } else if (!cpu->model) { in set_feature()
730 if (!test_bit(feat, cpu->model->def->full_feat)) { in set_feature()
733 name, cpu->model->def->name); in set_feature()
736 set_bit(feat, cpu->model->features); in set_feature()
738 clear_bit(feat, cpu->model->features); in set_feature()
751 if (!cpu->model) { in get_feature_group()
758 bitmap_and(tmp, cpu->model->features, def->feat, S390_FEAT_MAX); in get_feature_group()
759 value = bitmap_equal(tmp, def->feat, S390_FEAT_MAX); in get_feature_group()
772 if (dev->realized) { in set_feature_group()
776 } else if (!cpu->model) { in set_feature_group()
787 if (!bitmap_intersects(def->feat, cpu->model->def->full_feat, in set_feature_group()
791 name, cpu->model->def->name); in set_feature_group()
794 bitmap_or(cpu->model->features, cpu->model->features, def->feat, in set_feature_group()
797 bitmap_andnot(cpu->model->features, cpu->model->features, def->feat, in set_feature_group()
807 cpu->model = g_malloc0(sizeof(*cpu->model)); in s390_cpu_model_initfn()
809 cpu->model->def = xcc->cpu_def; in s390_cpu_model_initfn()
810 if (xcc->is_static) { in s390_cpu_model_initfn()
811 /* base model - features will never change */ in s390_cpu_model_initfn()
812 bitmap_copy(cpu->model->features, cpu->model->def->base_feat, in s390_cpu_model_initfn()
815 /* latest model - features can change */ in s390_cpu_model_initfn()
816 bitmap_copy(cpu->model->features, in s390_cpu_model_initfn()
817 cpu->model->def->default_feat, S390_FEAT_MAX); in s390_cpu_model_initfn()
826 void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga, in s390_set_qemu_cpu_model() argument
829 const S390CPUDef *def = s390_find_cpu_def(type, gen, ec_ga, NULL); in s390_set_qemu_cpu_model()
844 cpu->model = g_malloc0(sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
846 memcpy(cpu->model, &s390_qemu_cpu_model, sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
869 cpu->model = g_new(S390CPUModel, 1); in s390_max_cpu_model_initfn()
871 memcpy(cpu->model, max_model, sizeof(*cpu->model)); in s390_max_cpu_model_initfn()
878 g_free(cpu->model); in s390_cpu_model_finalize()
879 cpu->model = NULL; in s390_cpu_model_finalize()
884 return S390_CPU_GET_CLASS(obj)->is_migration_safe; in get_is_migration_safe()
889 return S390_CPU_GET_CLASS(obj)->is_static; in get_is_static()
894 return g_strdup(S390_CPU_GET_CLASS(obj)->desc); in get_description()
902 object_class_property_add_bool(oc, "migration-safe", get_is_migration_safe, in s390_cpu_model_class_register_props()
910 object_class_property_add(oc, def->name, "bool", get_feature, in s390_cpu_model_class_register_props()
912 object_class_property_set_description(oc, def->name, def->desc); in s390_cpu_model_class_register_props()
916 object_class_property_add(oc, def->name, "bool", get_feature_group, in s390_cpu_model_class_register_props()
918 object_class_property_set_description(oc, def->name, def->desc); in s390_cpu_model_class_register_props()
927 xcc->kvm_required = true; in s390_host_cpu_model_class_init()
928 xcc->desc = "KVM only: All recognized features"; in s390_host_cpu_model_class_init()
937 xcc->cpu_def = (const S390CPUDef *) data; in s390_base_cpu_model_class_init()
938 xcc->is_migration_safe = true; in s390_base_cpu_model_class_init()
939 xcc->is_static = true; in s390_base_cpu_model_class_init()
940 xcc->desc = xcc->cpu_def->desc; in s390_base_cpu_model_class_init()
948 xcc->cpu_def = (const S390CPUDef *) data; in s390_cpu_model_class_init()
949 xcc->is_migration_safe = true; in s390_cpu_model_class_init()
950 xcc->desc = xcc->cpu_def->desc; in s390_cpu_model_class_init()
957 xcc->is_migration_safe = true; in s390_qemu_cpu_model_class_init()
958 xcc->desc = g_strdup_printf("QEMU Virtual CPU version %s", in s390_qemu_cpu_model_class_init()
971 xcc->desc = in s390_max_cpu_model_class_init()
984 return g_strdup_printf(S390_CPU_TYPE_NAME("%s-base"), model_name); in s390_base_cpu_type_name()