Lines Matching +full:gen +full:- +full:2
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at
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),
59 CPUDEF_INIT(0x2064, 7, 2, 38, 0x00000000U, "z900.2", "IBM zSeries 900 GA2"),
63 CPUDEF_INIT(0x2084, 8, 2, 38, 0x00000000U, "z990.2", "IBM zSeries 990 GA2"),
67 CPUDEF_INIT(0x2086, 8, 4, 38, 0x00000000U, "z890.2", "IBM zSeries 880 GA2"),
71 CPUDEF_INIT(0x2094, 9, 2, 40, 0x00000000U, "z9EC.2", "IBM System z9 EC GA2"),
72 CPUDEF_INIT(0x2096, 9, 2, 40, 0x00000000U, "z9BC", "IBM System z9 BC GA1"),
74 CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM System z9 BC GA2"),
77 CPUDEF_INIT(0x2097, 10, 2, 43, 0x00000000U, "z10EC.2", "IBM System z10 EC GA2"),
78 CPUDEF_INIT(0x2098, 10, 2, 43, 0x00000000U, "z10BC", "IBM System z10 BC GA1"),
80 CPUDEF_INIT(0x2098, 10, 3, 43, 0x00000000U, "z10BC.2", "IBM System z10 BC GA2"),
82 CPUDEF_INIT(0x2817, 11, 2, 44, 0x08000000U, "z196.2", "IBM zEnterprise 196 GA2"),
83 CPUDEF_INIT(0x2818, 11, 2, 44, 0x08000000U, "z114", "IBM zEnterprise 114 GA1"),
85 CPUDEF_INIT(0x2827, 12, 2, 44, 0x08000000U, "zEC12.2", "IBM zEnterprise EC12 GA2"),
86 CPUDEF_INIT(0x2828, 12, 2, 44, 0x08000000U, "zBC12", "IBM zEnterprise BC12 GA1"),
88 CPUDEF_INIT(0x2964, 13, 2, 47, 0x08000000U, "z13.2", "IBM z13 GA2"),
89 CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
91 CPUDEF_INIT(0x3906, 14, 2, 47, 0x08000000U, "z14.2", "IBM z14 GA2"),
107 void s390_cpudef_featoff(uint8_t gen, uint8_t ec_ga, S390Feat feat) in s390_cpudef_featoff() argument
111 def = s390_find_cpu_def(0, gen, ec_ga, NULL); in s390_cpudef_featoff()
112 clear_bit(feat, (unsigned long *)&def->default_feat); in s390_cpudef_featoff()
115 void s390_cpudef_featoff_greater(uint8_t gen, uint8_t ec_ga, S390Feat feat) in s390_cpudef_featoff_greater() argument
122 if (def->gen < gen) { in s390_cpudef_featoff_greater()
125 if (def->gen == gen && def->ec_ga < ec_ga) { in s390_cpudef_featoff_greater()
129 clear_bit(feat, (unsigned long *)&def->default_feat); in s390_cpudef_featoff_greater()
133 void s390_cpudef_group_featoff_greater(uint8_t gen, uint8_t ec_ga, in s390_cpudef_group_featoff_greater() argument
140 bitmap_complement(group_def_off, group_def->feat, S390_FEAT_MAX); in s390_cpudef_group_featoff_greater()
145 if (cpu_def->gen < gen) { in s390_cpudef_group_featoff_greater()
148 if (cpu_def->gen == gen && cpu_def->ec_ga < ec_ga) { in s390_cpudef_group_featoff_greater()
152 bitmap_and((unsigned long *)&cpu_def->default_feat, in s390_cpudef_group_featoff_greater()
153 cpu_def->default_feat, group_def_off, S390_FEAT_MAX); in s390_cpudef_group_featoff_greater()
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()
280 return s390_cpu_defs[i].gen; in s390_get_gen_for_cpu_type()
286 const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga, in s390_find_cpu_def() argument
293 if (!gen) { in s390_find_cpu_def()
296 if (!gen && type) { in s390_find_cpu_def()
297 gen = s390_get_gen_for_cpu_type(type); in s390_find_cpu_def()
305 if (gen) { in s390_find_cpu_def()
306 if (def->gen > gen) { in s390_find_cpu_def()
308 } else if (def->gen == gen && ec_ga && def->ec_ga > ec_ga) { in s390_find_cpu_def()
315 bitmap_andnot(missing, def->base_feat, features, S390_FEAT_MAX); in s390_find_cpu_def()
327 if (def->type == type && def->ec_ga == ec_ga) { in s390_find_cpu_def()
331 if (def->type == type) { in s390_find_cpu_def()
350 if (scc->is_static) { in s390_print_cpu_model_list_entry()
353 if (scc->is_migration_safe) { in s390_print_cpu_model_list_entry()
354 g_string_append(details, "migration-safe, "); in s390_print_cpu_model_list_entry()
356 if (cc->deprecation_note) { in s390_print_cpu_model_list_entry()
359 if (details->len) { in s390_print_cpu_model_list_entry()
361 g_string_truncate(details, details->len - 2); in s390_print_cpu_model_list_entry()
364 /* strip off the -s390x-cpu */ in s390_print_cpu_model_list_entry()
365 g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; in s390_print_cpu_model_list_entry()
366 if (details->len) { in s390_print_cpu_model_list_entry()
367 qemu_printf(" %-15s %-35s (%s)\n", name, scc->desc, details->str); in s390_print_cpu_model_list_entry()
369 qemu_printf(" %-15s %-35s\n", name, scc->desc); in s390_print_cpu_model_list_entry()
386 return -1; in s390_cpu_list_compare()
390 return -1; in s390_cpu_list_compare()
394 return -1; in s390_cpu_list_compare()
400 if (cc_a->cpu_def != cc_b->cpu_def) { in s390_cpu_list_compare()
401 return cc_a->cpu_def - cc_b->cpu_def; in s390_cpu_list_compare()
404 /* exact same definition - list base model first */ in s390_cpu_list_compare()
405 return cc_a->is_static ? -1 : 1; in s390_cpu_list_compare()
424 qemu_printf(" %-20s %s\n", def->name, def->desc); in s390_cpu_list()
431 qemu_printf(" %-20s %s\n", def->name, def->desc); in s390_cpu_list()
437 static int dep[][2] = { in check_consistency()
499 if (test_bit(dep[i][0], model->features) && in check_consistency()
500 !test_bit(dep[i][1], model->features)) { in check_consistency()
502 s390_feat_def(dep[i][0])->name, in check_consistency()
503 s390_feat_def(dep[i][1])->name); in check_consistency()
518 msg, max_model->def->name); in check_compat_model_failed()
519 error_append_hint(errp, "Consider a different accelerator, try \"-accel help\"\n"); in check_compat_model_failed()
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()
541 "the --only-migratable option. You must remove either " in check_compatibility()
542 "the 'unpack' facility or the --only-migratable option"); in check_compatibility()
548 bitmap_andnot(missing, model->features, max_model->features, S390_FEAT_MAX); in check_compatibility()
591 if (xcc->kvm_required && !kvm_enabled()) { in s390_realize_cpu_model()
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()
624 cpu->env.cpuid = deposit64(cpu->env.cpuid, CPU_PHYS_ADDR_SHIFT, in s390_realize_cpu_model()
625 CPU_PHYS_ADDR_BITS, cpu->env.core_id); in s390_realize_cpu_model()
637 if (!cpu->model) { in get_feature()
643 value = test_bit(feat, cpu->model->features); in get_feature()
655 if (dev->realized) { in set_feature()
659 } else if (!cpu->model) { in set_feature()
669 if (!test_bit(feat, cpu->model->def->full_feat)) { 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()
697 bitmap_and(tmp, cpu->model->features, def->feat, S390_FEAT_MAX); in get_feature_group()
698 value = bitmap_equal(tmp, def->feat, S390_FEAT_MAX); in get_feature_group()
711 if (dev->realized) { in set_feature_group()
715 } else if (!cpu->model) { in set_feature_group()
726 if (!bitmap_intersects(def->feat, cpu->model->def->full_feat, 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()
748 cpu->model->def = xcc->cpu_def; in s390_cpu_model_initfn()
749 if (xcc->is_static) { 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()
765 void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga, in s390_set_qemu_cpu_model() argument
768 const S390CPUDef *def = s390_find_cpu_def(type, gen, ec_ga, NULL); in s390_set_qemu_cpu_model()
783 cpu->model = g_malloc0(sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
785 memcpy(cpu->model, &s390_qemu_cpu_model, sizeof(*cpu->model)); in s390_qemu_cpu_model_initfn()
808 cpu->model = g_new(S390CPUModel, 1); 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()
823 return S390_CPU_GET_CLASS(obj)->is_migration_safe; in get_is_migration_safe()
828 return S390_CPU_GET_CLASS(obj)->is_static; in get_is_static()
833 return g_strdup(S390_CPU_GET_CLASS(obj)->desc); in get_description()
841 object_class_property_add_bool(oc, "migration-safe", get_is_migration_safe, in s390_cpu_model_class_register_props()
849 object_class_property_add(oc, def->name, "bool", get_feature, in s390_cpu_model_class_register_props()
851 object_class_property_set_description(oc, def->name, def->desc); in s390_cpu_model_class_register_props()
855 object_class_property_add(oc, def->name, "bool", get_feature_group, in s390_cpu_model_class_register_props()
857 object_class_property_set_description(oc, def->name, def->desc); in s390_cpu_model_class_register_props()
866 xcc->kvm_required = true; in s390_host_cpu_model_class_init()
867 xcc->desc = "KVM only: All recognized features"; in s390_host_cpu_model_class_init()
876 xcc->cpu_def = (const S390CPUDef *) data; in s390_base_cpu_model_class_init()
877 xcc->is_migration_safe = true; in s390_base_cpu_model_class_init()
878 xcc->is_static = true; in s390_base_cpu_model_class_init()
879 xcc->desc = xcc->cpu_def->desc; in s390_base_cpu_model_class_init()
887 xcc->cpu_def = (const S390CPUDef *) data; in s390_cpu_model_class_init()
888 xcc->is_migration_safe = true; in s390_cpu_model_class_init()
889 xcc->desc = xcc->cpu_def->desc; in s390_cpu_model_class_init()
896 xcc->is_migration_safe = true; in s390_qemu_cpu_model_class_init()
897 xcc->desc = g_strdup_printf("QEMU Virtual CPU version %s", in s390_qemu_cpu_model_class_init()
910 xcc->desc = in s390_max_cpu_model_class_init()
923 return g_strdup_printf(S390_CPU_TYPE_NAME("%s-base"), model_name); in s390_base_cpu_type_name()